Search Questions

Company: COGNIZANT

#1

On a popular discussion platform, some users with harmful intentions use anagram-based methods to hide certain banned terms. An anagram is a word or phrase created by rearranging the letters of another word or phrase, using all the original letters exactly once. Implement a function to identify and group anagrams within the network's data log to detect these concealment attempts.

Write a Python

Asked in: COGNIZANT


Buyer: 1
Code Size:
#2

Stemming is the process of extracting the base word from a word. For instance, the base for "worked" is "work". Use the following algorithm to stem a word: 1. If the word ends in 'ed', 'ly', or 'ing', remove the suffix. 2. If the resulting word is longer than 8 letters, keep the first 8 letters. Implement a function that takes a string of space-separated words and returns its stemmed counterpart.

Asked in: COGNIZANT


Buyer: 0
Code Size:
#3

A substring is a group of contiguous characters in a string. For instance, all substrings of abc are [a, b, c, ab, bc, abc].

Given a binary representation of a number, determine the total number of substrings present that match the following conditions:

1. The 0s and 1s are grouped consecutively (e.g., 01, 10, 0011, 1100, 000111, etc.).
2. The number of 0s in the substring is equal to the n

Asked in: Cognizant


Buyer: 0
Code Size: