[Codeforces] Alpha Round 20 (Codeforces format) B. EquationRead more
[Codeforces] Alpha Round 21 (Codeforces format) B. IntersectionRead more
[Hacker Earth] Space smugglersRead more
[Hacker Earth] Largest WindmillRead more
[Hacker Earth] Longest Paths in TreeRead more
[Hacker Earth] Xor RectangleRead more
[Hacker Earth] Mancunian and Pandigital NumbersRead more
[LeetCode] Assign Cookies

455. Assign Cookies

Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie.

Each child i has a greed factor g[i], which is the minimum size of a cookie that the child will be content with; and each cookie j has a size s[j]. If s[j] >= g[i], we can assign the cookie j to the child i, and the child i will be content. Your goal is to maximize the number of your content children and output the maximum number.

Read more
[System Design] What is Serverless Architecture

What is Serverless Architecture

Read more
[LeetCode] Palindrome Rearrangement Queries

10034. Palindrome Rearrangement Queries

You are given a 0-indexed string s having an even length n.

You are also given a 0-indexed 2D integer array, queries, where queries[i] = [ai, bi, ci, di].

For each query i, you are allowed to perform the following operations:

  • Rearrange the characters within the substring s[ai:bi], where 0 <= ai <= bi < n / 2.
  • Rearrange the characters within the substring s[ci:di], where n / 2 <= ci <= di < n.

For each query, your task is to determine whether it is possible to make s a palindrome by performing the operations.

Each query is answered independently of the others.

Return a 0-indexed array answer, where answer[i] == true if it is possible to make s a palindrome by performing operations specified by the ith query, and false otherwise.

  • A substring is a contiguous sequence of characters within a string.
  • s[x:y] represents the substring consisting of characters from the index x to index y in s, both inclusive.
Read more