Showing posts with the label Character Arrays and 2D ArraysShow all
Write a program to do basic string compression. For a character which is consecutively repeated more than once, replace consecutive duplicate occurrences with the count of repetition.
For a given a string(str), find and return the highest occurring character.
For a given a string(str) and a character X, write a function to remove all the occurrences of X from the given string.
Aadil has been provided with a sentence in the form of a string as a function parameter. The task is to implement a function so as to print the sentence such that each word in the sentence is reversed.
For a given string(str), remove all the consecutive duplicate characters.
For a given two strings, 'str1' and 'str2', check whether they are a permutation of each other or not.
For a given two-dimensional integer array/list of size (N x M), print it in a spiral form. That is, you need to print in the order followed for every iteration:
For a given two-dimensional integer array/list of size (N x M), print the array/list in a sine wave order, i.e, print the first column top to bottom, next column bottom to top and so on.
For a given two-dimensional integer array/list of size (N x M), you need to find out which row or column has the largest sum(sum of all the elements in a row/column) amongst all the rows and columns.
Given a 2D integer array of size M*N, find and print the sum of ith column elements separated by space.
Reverse the given string word wise. That is, the last word in given string should come at 1st place, last second word at 2nd place and so on. Individual words should remain as it is.
Given an input string S that contains multiple words, you need to remove all the spaces present in the input string.
Given an input string S and two characters c1 and c2, you need to replace every occurrence of character c1 with character c2 in the given string.
Given a string, determine if it is a palindrome, considering only alphanumeric characters.