Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
823 views
in Online Assessments by Expert (111,530 points) | 823 views

1 Answer

0 like 0 dislike
  1. Given a string s, count number of substrings of length 3 that comprises of distinct letters.
  2. I forgot...
  3. Newspaper Editing:
    Given an array of paragraphs p, where each paragraph is an array of words.
    Also given an integer width.
    Rules for editing:
    • words on the same line is separated by a single space.
    • The length of one line must not exceed width; if the length of one line len ismaller then width, pad the beginning and the end of line with white spaces. If lenis even, then pad beginning and end with len/2 spaces. If len is odd, pad beginning and end with floor(len/2) and ceil(len/2) spaces, respectively.
    • Add one asterisk (* ) to the front and back of each line; asterisks does not count towards the length of the line.
    • Add a line made up of asterisks before the first line and after the last line.
  4. Count Bytes Stored
    You are provided with an array A that represents a stream of data, and each element (a chunk) A_i is an array of two integers [start, end], which represents the byte addresses used to store the incoming data at time i. For example, a chunk [1, 3] means that the data is stored on byte 1, 2, and 3.
    Return an array count, such that each element count_i represents the number of bytes used. NOTE: chunk may overlap e.g. [1, 3] overlaps with 2, 5
by Expert (111,530 points)