Category: string
Given a string (you may assume it is lowercase letters only), your task is to find out the first unique letter and return its index. If it does not …
Simplify an absolute path for a file (Unix-style): For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" Did you consider the case where path = “/../”? …
Write a method that reverses the given input string. Example: Given s = “12345”, return “54321”. STL The C++ STL provides the reverse method that does the job. class …
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 …
Given two binary strings, return their sum (also a binary string). For example, a = “11” b = “1” Return “100”. It looks easy however may not seem so: …