Implement strstr function in Java
Write an efficient algorithm to implement the strstr function in Java, which returns the index of the first occurrence of a string in another string.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedWrite an efficient algorithm to implement the strstr function in Java, which returns the index of the first occurrence of a string in another string.
Write an efficient function to implement the atoi function in C. The standard atoi() function converts input C-string to its corresponding integer value.
Write an efficient function to implement the itoa() function in C. The standard itoa() function converts input number to its corresponding C-string using the specified base.
This post will discuss how to validate an IP address (IPv4) in C++. A valid IPv4 address must be in the form of xxx.xxx.xxx.xxx, where xxx is a number from 0-255.
This post will discuss how to reverse a string in Java in 10 different ways. For example, the reverse of “Techie Delight” is “thgileD eihceT”.
Given an expression containing numeric operands with addition and subtraction operators, evaluate it. The expression may contain sub-expressions enclosed in opening and closing braces.
Given the string representation of a non-negative integer and an integer k, find the smallest number that remains after taking out k digits from it.
A string that may contain multiple consecutive instances of the same value is encoded to only store that value and its count. Given such an encoded sequence, decode it.
Given a string, find the length of the longest palindrome possible from its characters.
Given two strings, check if the second string can be constructed from characters of the first string, where each character of the first string can be used only once in the second string.
Given two strings, check if the second string is a subsequence of the first string.
Given a set of strings, print all pairs of anagrams together. Two strings, X and Y, are called anagrams if we can get a string Y by rearranging the letters of the string X and using all the characters of the string X exactly once.