Splitting Comma-Separated Values in MySQL and Performing Count Statistics
Splitting Strings Using Built-in Tables
To transform a comma-separated string into rows, the help_topic system table can be used. This approach leverages the sequential IDs present in the table.
SELECT
SUBSTRING_INDEX(
SUBSTRING_INDEX('a,b,c,d,e,f,g,h', ',', help_topic_id + 1),
',',
-1
) AS extracted_value
FROM mysql.help_top ...
Posted on Sat, 19 Sep 2026 16:18:19 +0000 by MHardeman25
C Programming Techniques: Pointer Arithmetic, Array Operations, and String Processing
Locating Array Extrema Using Pointer Parameters
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#define SIZE 5
void populate(int arr[], int len);
void display(const int arr[], int len);
void compute_bounds(const int arr[], int len, int* smallest, int* largest);
int main(void) {
int values[SIZE];
int minimum, maximum;
...
Posted on Fri, 04 Sep 2026 16:22:57 +0000 by Dj Kat
C++ String-Based Hexadecimal to Octal Conversion
Problem Specification
Given a set of positive hexadecimal integers, transform each into its octal equivalent. The input provides a count n (1 ≤ n ≤ 10), followed by n strings composed of digits 0-9 and uppercase letters A-F. Each string can be up to 100,000 characters long. Neither the input nor the output should contain leading zeros.
Convers ...
Posted on Mon, 24 Aug 2026 16:48:57 +0000 by Cagecrawler
Algorithm Analysis: Binary Reduction, Happy String, and Stone Game
Reducing a Binary Number to OneGiven a binary string representing a positive integer, the objective is to reduce this number to 1 using the minimum number of steps. The operations allowed are:If the current number is even, divide it by 2.If the current number is odd, add 1 to it.Since the input length can be up to 500, converting the binary str ...
Posted on Sun, 23 Aug 2026 16:46:51 +0000 by ElectricRain
Competitive Programming Problem Solutions: BFS, String Manipulation, and Mathematical Logic
This problem involves a BFS simulation on an ice floor grid. The movement mechanics require sliding in a chosen direction until hitting an obstacle. The algorithm explores four directions from each position, continuing to slide until a wall is encountered, at which point the stopping position becomes a new node in the traversal.
Key implementat ...
Posted on Thu, 20 Aug 2026 16:34:01 +0000 by jj33
Python Essentials for Competitive Programming and Algorithm Contests
1. Efficient Input Handling
In competitive programming, reading data efficiently is crucial. Python provides several ways to handle single and multiple lines of input.
# Reading a single string
user_data = input()
# Reading and converting to an integer
base_value = int(input())
# Reading multiple space-separated integers into variables
start, ...
Posted on Thu, 06 Aug 2026 16:30:36 +0000 by jpraj
C Programming Algorithms: String Manipulation, Arrays, and Matrix Operations
Alphabetic Substitution CipherImplementing a Caesar-like cipher that shifts English letters by one position while inverting their case. Lowercase letters become uppercase and shift forward, while uppercase letters become lowercase and shift forward.#include <stdio.h>
#include <ctype.h>
int main() {
int current_char;
while ( ...
Posted on Mon, 03 Aug 2026 16:33:56 +0000 by LiamH
Solutions for Codeforces Round 855 (Div. 3)
Problem A: Is It a Cat?
Givan a string and its length, output "YES" if the string satisfies the following conditions; otherwise, output "NO":
The string consists of exactly four segments.
Each segment contains only one letter (case-insensitive), in the exact sequence: 'm', 'e', 'o', 'w'.
There are t test cases.
Approach
Th ...
Posted on Mon, 27 Jul 2026 17:02:01 +0000 by mindrage00
Bash String Manipulation Techniques
Concatenating StringsVariables can be joined by placing them adjacent to each other.prefix="sys"
suffix="_log"
combined="${prefix}${suffix}"
echo "$combined" # Output: sys_logExtracting Substrings by IndexRetrieve a portion of a string by specifying the starting position and length using the format ${variable:offset:length}.text="deployment"
s ...
Posted on Sun, 19 Jul 2026 16:51:45 +0000 by kitegirl
Python Data Processing and String Manipulation Exercises
Selective Divisor Extraction
Identify integers within a specified range that are divisible by either 5 or 6, but exclude those divisible by both (30).
def find_special_divisors(limit=10000):
results = []
for num in range(1, limit + 1):
if (num % 5 == 0 or num % 6 == 0) and num % 30 != 0:
results.append(num)
retur ...
Posted on Fri, 03 Jul 2026 17:32:59 +0000 by Javizy