Fading Coder

One Final Commit for the Last Sprint

Custom String Operations and Advanced Pointer Concepts in C

Custom String Functions Implementations of common string operatiosn without standard library functions. #include <stdio.h> #include <stddef.h> // Calculate string length size_t custom_strlen(const char *str) { size_t len = 0; while (str[len] != '\0') { len++; } return len; } // Compare t...

Extracting Specific Text Segments from Multiple PDFs Using Python

Implementation Too isolate specific text bounded by defined markers within multiple PDF documents, we can utilize the PyPDF2 library. The following script defines a function that scens each page of a given document, locates the start and end markers, and retrieves the content sandwiched between them...

Solutions for SMU Summer 2023 Contest Round 15

Problem A – AB Balance For each test case a string s (only the characters 'a' and 'b') is given. Let cntAB be the number of occurrences of the substring "ab" and cntBA the number of occurrences of "ba". The task is to make the two counts equal by changing at most one character of...

Python Fundamentals: Variables and Data Types

Variable Naming Conventions Names can include letters, digits, and underscores, but must not start with a digit Spaces are not allowed in variable names Names must not conflict with Python keywords Prefer short, descriptive names for clarity String Handling Strings in Python are enclosed in either s...

C Programming Techniques for String Analysis and Array Transformations

Palindrome Validation with Bidirectional Traversal Determining whether a sequence reads identically from both directions can be achieved without auxiliary buffers by employing converging indices: #include <stdio.h> #include <stdbool.h> #include <string.h> #define BUFFER_SIZE 100 bo...

C++ String Manipulation and Common Algorithms

C++ String Representation C++ supports text processing through two primary mechanisms: the traditional C-style character array and the standard std::string class introduced in the C++ Standard Library. C-Style Strings Originating from the C language, C-style strings are essentially one-dimensional a...

JavaScript String Manipulation Essentials

Accessing the length property returns the total number of characters in a string. const greeting = "Hi"; console.log(greeting.length); // 2 const empty = ""; console.log(empty.length); // 0 Extracting Segments with substring The substring(start, end) method extracts characters be...

Implementing String Manipulation Algorithms in Java

Core Concepts for String Operations Java Input/Output Basics For reading from standard input: Scanner sc = new Scanner(System.in); For writing to standard output: System.out.println(); String Characteristics in Java Strings are immutable objects in Java. The length of a string can be obtained using...

Filtering Vowels and Formatting Consonants in Strings

The task requires processing an input string to remove all vowel characters (A, O, Y, E, U, I in both upper and lower case) and then format the remaining consonant characters. The formatting involves prefixing each consonant with a period ('.') and converting the character to its lowercase form. The...

Day 9: String Manipulation Part 2

151. Reverse Words in a String Given a string, reverse the order of its words (with each word’s internal characters remaining in their original order). The result must not contain leading/trailing spaces, and consecutive words must be separated by exact one space. Examples: Input: "the sky is b...