- Given a string
s, count number of substrings of length 3 that comprises of distinct letters. - I forgot...
- Newspaper Editing:
Given an array of paragraphsp, where each paragraph is an array of words.
Also given an integerwidth.
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 linelenismaller thenwidth, pad the beginning and the end of line with white spaces. Iflenis even, then pad beginning and end withlen/2spaces. Iflenis odd, pad beginning and end withfloor(len/2)andceil(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.
- Count Bytes Stored
You are provided with an arrayAthat represents a stream of data, and each element (a chunk)A_iis an array of two integers[start, end], which represents the byte addresses used to store the incoming data at timei. For example, a chunk[1, 3]means that the data is stored on byte 1, 2, and 3.
Return an arraycount, such that each elementcount_irepresents the number of bytes used. NOTE: chunk may overlap e.g.[1, 3]overlaps with2, 5.
Comments (5)


