Tag: C++ coding exercise
Reverse a linked list from position m to n. For example: Given 1-2-3-4-5-NULL, m = 2 and n = 4, return 1-4-3-2-5-NULL. 1 ≤ m ≤ n ≤ length …
Remove the nth node from the end of a singly linked list and return its head. For example, input: 1-2-3-4-5, and n = 2. Removing the second node from …
Write a function to reverse only the vowels of a string. Example: Given s = “hello”, return “holle”. A vowel is one of the following 10 letters (both uppercase …
Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division …
Write a function to find the longest common prefix string amongst an array of strings. For example, should return “a”. The common prefix length should not exceed the minimal …