4 views
24 Jan 2026
Input is a single string s is provided (can contain spaces). Output its length, first character and last character. If string is empty, output 0 - -....
3 views
24 Jan 2026
Input is a single string s is provided (no trailing spaces needed). Output the reversed string....
2 views
24 Jan 2026
A string s is provided. Count how many vowels (a,e,i,o,u) are present (both cases). Output the count....
3 views
24 Jan 2026
A string s is provided. Convert lowercase to uppercase and uppercase to lowercase. Other characters keep same. Output final string....
3 views
24 Jan 2026
A string s is provided. Remove all space characters and output the new string....
3 views
24 Jan 2026
A string s (only letters and digits) is provided. Output YES if it is palindrome else NO....
3 views
24 Jan 2026
A string s is provided and a character ch is provided. Count how many times ch occurs in s....
2 views
24 Jan 2026
A string s is provided, and two characters a and b. Replace every a with b and output result....
2 views
24 Jan 2026
A sentence line is provided with words separated by spaces. Join words using '-' and output....
2 views
24 Jan 2026
Read two strings s and p. Output YES if s starts with p else NO....
3 views
24 Jan 2026
A string s is provided. Compress it using run-length encoding as: char followed by count (only when count>1). Output encoded string....
2 views
24 Jan 2026
An encoded string is provided like a3b2c (letters with optional number). Decode and output the original string....
2 views
24 Jan 2026
A sentence is provided. Words are separated by spaces. Output the longest word. If tie, output the first one....
3 views
24 Jan 2026
A string s is provided (no spaces). Remove consecutive duplicate characters and output result....
3 views
24 Jan 2026
A string s is provided (no spaces). Output the first character that appears exactly once. If none, output -1....
4 views
24 Jan 2026
Input has two strings a and b are provided (lowercase letters). Output YES if they are anagrams else NO....
3 views
24 Jan 2026
A string s and integer k are provided. Rotate string to the right by k positions and output....
4 views
24 Jan 2026
A string s is provided containing only '(' and ')'. Output YES if it is balanced else NO....
2 views
24 Jan 2026
Read two strings s and p. Output all starting indices (0-based) where p occurs in s. If none, output -1....
2 views
24 Jan 2026
A string s is provided (maybe with leading spaces and sign). Parse first integer like simple atoi. If no number, output 0....
2 views
24 Jan 2026
Read n strings. Output their longest common prefix. If no common prefix, output EMPTY....
2 views
24 Jan 2026
A string s is provided. Remove all digits (0-9) and output remaining string....
3 views
24 Jan 2026
A string s is provided and integer k. Output the lexicographically smallest substring of length k. If k>len(s), output EMPTY....
2 views
24 Jan 2026
A sentence is provided. Reverse order of words and output. Extra spaces should be treated as separators....
3 views
24 Jan 2026
Read two strings text and pattern. Count how many times pattern occurs in text (overlapping allowed). Output the count....
2 views
24 Jan 2026
A string s is provided (no spaces). Compute length of longest palindromic substring. Use linear-time method....
4 views
24 Jan 2026
A string is provided in form like 3[a2[c]] where number means repeat. Decode and output the final string....
2 views
24 Jan 2026
Read two strings s and p. Remove every occurrence of p from s while scanning left to right (like stack remove). Output final string....
3 views
24 Jan 2026
A string s is provided. Consider all rotations of s. Output the lexicographically smallest rotation....
2 views
24 Jan 2026
Read string s and pattern p with '?' (any char) and '*' (any sequence). Output YES if pattern matches whole string else NO....
3 views
24 Jan 2026
A string s is provided (no spaces). Compute minimum insertions needed to make it a palindrome. Output the number....
3 views
24 Jan 2026
A string s and integer k are provided. Pick a subsequence of length k (keep order) with smallest lexicographic value. Output that subsequence....
3 views
24 Jan 2026
Two non-negative integers a and b are provided as strings (very large). Output a+b....
3 views
24 Jan 2026
Input has two strings s and t are provided (same length). Two strings are isomorphic if each character in s can be mapped to exactly one character in t and vice-versa. Output YES or NO....
3 views
24 Jan 2026
Read two strings text and pattern. Count how many times pattern occurs in text (overlapping allowed). Use Z algorithm logic and output count....