Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [string-processing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
2 answers
169 views

Truncating/abbreviating strings in the middle with an ellipsis (…) (or other) separators with a fixed character limit

Problem For some user-facing string, I want to truncate it to some given maximum length (also useful for file name/path lengths on Windows etc.). However, I want to do it a little more elaborately ...
rklec's user avatar
  • 63
4 votes
2 answers
436 views

Z-Function/ Algorithms on strings. C++

The problem: Given a string s. For each i from 1 to |s|, find the number of occurrences of its prefix of length i in the string. Input: The first line of input contains an integer q (1≤q≤10⁵) — the ...
neely's user avatar
  • 43
0 votes
2 answers
118 views

Advent of Code 2023 - Day 19: Aplenty (Part 1)

Description: The task involves processing a set of workflows, each comprising rules. These rules define conditions based on part ratings and dictate the destination workflow if the conditions are ...
Harith's user avatar
  • 7,404
0 votes
2 answers
69 views

Advent of Code 2023 - Day 15: Lens Library

Part 1: The task involves initializing the Lava Production Facility using an initialization sequence. The sequence consists of steps, each requiring the application of the Holiday ASCII String Helper ...
Harith's user avatar
  • 7,404
0 votes
1 answer
50 views

Advent of Code 2023 - Day 9: Mirage Maintenance

Part 1: The task involves analyzing an environmental report from an oasis using the Oasis And Sand Instability Sensor (OASIS). The report consists of multiple histories, each containing a sequence of ...
Harith's user avatar
  • 7,404
0 votes
1 answer
56 views

Advent of Code 2023 - Day 8: Haunted Wasteland (Part 1)

Description: The task involves navigating a haunted wasteland on a desert island using a camel. The objective is to escape from the current position (AAA) to the destination (ZZZ) by following left/...
Harith's user avatar
  • 7,404
4 votes
1 answer
106 views

Advent of Code 2023 - Day 6: Wait For It

Part One: The task involves organizing multiple toy boat races, each assigned a specific race time and a recorded distance. To surpass the existing record, participants must optimize the duration of ...
Harith's user avatar
  • 7,404
2 votes
1 answer
129 views

Advent of Code 2023 - Day 5: If You Give A Seed A Fertilizer (Part 1)

The task involves determining the lowest location number corresponding to a given set of seeds by following numerical mappings for soil, fertilizer, water, light, temperature, humidity, and location. ...
Harith's user avatar
  • 7,404
3 votes
2 answers
166 views

Advent of Code 2023 - Day 4: Scratchcards

Part 1: The task involves determining the total points of a set of scratchcards. Each scratchcard contains two lists of numbers: the winning numbers and the numbers the player has. Points are awarded ...
Harith's user avatar
  • 7,404
6 votes
2 answers
213 views

Advent of Code 2023 day 1: Trebuchet (Part 1 and 2) Follow-up

This is a follow-up to the question asked here: Advent of Code 2023 day 1: Trebuchet (Part 1 and 2) Changes made: The code no longer assumes that all lines will fit into a fixed-size buffer. Although ...
Harith's user avatar
  • 7,404
1 vote
2 answers
541 views

Split netmask or ip address

I've written a python function to split a netmask or an ip address. The code is about to become part of a custom router api. ...
Looser User's user avatar
1 vote
0 answers
51 views

I'm writing the command processing part of the tui for a basic task manager/todo list application

The idea is that the TUI struct handles what gets printed to the terminal (I will make it pretty in the future, right now I'm just building its core functionalities) and for processing input. It's ...
dumb_ptr's user avatar
4 votes
2 answers
299 views

LKM: Extract cpu model name from /proc/cpuinfo

I wrote a small LKM that opens the /proc/cpuinfo file, reads it line by line, and attempts to the cpu model name. If the function fails to extract the cpu model ...
766F6964's user avatar
  • 901