Questions for Day 4 - (24/06/2024)

DSA

Question 1: Given a string, determine the number of distinct palindromic substrings of a specified length.

Inputs:
  • A string.
  • An integer representing the length of the substrings.
Output:
  • The number of distinct palindromic substrings.
Example:

string = "ababa"

length = 3

Output: 3

Question 2: Determine if a string can be rearranged such that all characters have the same frequency. If one removal can achieve this, return "valid", otherwise return "invalid".

Inputs:
  • A string.
Output:
  • "valid" if the string meets the criteria, otherwise "invalid".
Example:

string = "aabbcc"

Output: valid

WEB-DEV:

  1. Try recreating this image using display element (the logo of google is provided in the repo).

    image

  2. Try recreating this image using display inline and block element.

    image

  3. Create a grid with 4 equal columns that take up the entire page. Space between columns = 20px, space between rows = 10p

    image