Skip to content

  • Home
    • Featured Questions
    • Latest Updates
  • Subjects
    • Mathematics
    • Science
    • Computers
    • English
    • General Knowledge
    • History
  • Tips & Strategies
    • Test taking strategy
    • Stress Management
    • Time Management
  • Tools & Utilities
    • Generate Speech From Text
    • Change Your Voice
    • Generate Image From Text
    • Compress Your Images
  • Contact
    • Privacy Policy
    • Mission & Vision
  • Toggle search form

Tag: LeetCode Hard

LeetCode Hard – Scramble String

Posted on February 10, 2024 By allexamprep.com No Comments on LeetCode Hard – Scramble String

We can scramble a string s to get a string t using the following algorithm: Given two strings s1 and s2 of the same length, return true if s2 is a scrambled string of s1, otherwise, return false. Example 1:Input: s1 = “great”, s2 = “rgeat” Output: true Explanation: One possible scenario applied on s1 is: “great” –> “gr/eat” // divide at random index. “gr/eat” –>…

Read More “LeetCode Hard – Scramble String” »

LEETCode

LeetCode Hard – Maximal Rectangle

Posted on February 10, 2024 By allexamprep.com No Comments on LeetCode Hard – Maximal Rectangle

Given a rows x cols binary matrix filled with 0‘s and 1‘s, find the largest rectangle containing only 1‘s and return its area. Example 1: Input: matrix = [[“1″,”0″,”1″,”0″,”0”],[“1″,”0″,”1″,”1″,”1”],[“1″,”1″,”1″,”1″,”1”],[“1″,”0″,”0″,”1″,”0”]] Output: 6 Explanation: The maximal rectangle is shown in the above picture. Example 2: Input: matrix = [[“0”]] Output: 0 Example 3: Input: matrix = [[“1”]] Output: 1 Constraints: Java Solution To solve this…

Read More “LeetCode Hard – Maximal Rectangle” »

LEETCode

LeetCode Hard – Largest Rectangle in Histogram

Posted on February 10, 2024February 10, 2024 By allexamprep.com No Comments on LeetCode Hard – Largest Rectangle in Histogram

Given an array of integers heights representing the histogram’s bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram. Example 1: Input: heights = [2,1,5,6,2,3] Output: 10 Explanation: The above is a histogram where width of each bar is 1. The largest rectangle is shown in the red area,…

Read More “LeetCode Hard – Largest Rectangle in Histogram” »

LEETCode

LeetCode Hard – Minimum Window Substring

Posted on February 10, 2024 By allexamprep.com No Comments on LeetCode Hard – Minimum Window Substring

Given two strings s and t of lengths m and n respectively, return the minimum window  substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string “”. The testcases will be generated such that the answer is unique. Example 1:Input: s = “ADOBECODEBANC”, t = “ABC” Output: “BANC” Explanation: The minimum window substring “BANC” includes ‘A’, ‘B’,…

Read More “LeetCode Hard – Minimum Window Substring” »

LEETCode

LeetCode Hard – Text Justification

Posted on February 10, 2024February 10, 2024 By allexamprep.com No Comments on LeetCode Hard – Text Justification

Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justified. You should pack your words in a greedy approach; that is, pack as many words as you can in each line. Pad extra spaces ‘ ‘ when…

Read More “LeetCode Hard – Text Justification” »

LEETCode

LeetCode Hard — Valid Number

Posted on February 10, 2024February 10, 2024 By allexamprep.com No Comments on LeetCode Hard — Valid Number

A valid number can be split up into these components (in order): A decimal number can be split up into these components (in order): An integer can be split up into these components (in order): For example, all the following are valid numbers: [“2”, “0089”, “-0.1”, “+3.14”, “4.”, “-.9”, “2e10”, “-90E3”, “3e+7”, “+6e-1”, “53.5e93”, “-123.456e789”], while the following are not valid numbers: [“abc”,…

Read More “LeetCode Hard — Valid Number” »

LEETCode

LeetCode Hard –  Permutation Sequence

Posted on February 10, 2024 By allexamprep.com No Comments on LeetCode Hard –  Permutation Sequence

The set [1, 2, 3, …, n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, we get the following sequence for n = 3: Given n and k, return the kth permutation sequence. Example 1:Input: n = 3, k = 3 Output: “213” Example 2:Input: n = 4, k = 9 Output: “2314” Example 3:Input: n =…

Read More “LeetCode Hard –  Permutation Sequence” »

LEETCode

LeetCode Hard — N-Queens II

Posted on February 10, 2024 By allexamprep.com No Comments on LeetCode Hard — N-Queens II

The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. Given an integer n, return the number of distinct solutions to the n-queens puzzle. Example 1: Input: n = 4 Output: 2 Explanation: There are two distinct solutions to the 4-queens puzzle as shown. Example 2:Input: n = 1 Output:…

Read More “LeetCode Hard — N-Queens II” »

LEETCode

LeetCode Hard – N-Queens

Posted on February 10, 2024February 10, 2024 By allexamprep.com No Comments on LeetCode Hard – N-Queens

The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle. You may return the answer in any order. Each solution contains a distinct board configuration of the n-queens’ placement, where ‘Q’ and ‘.’ both indicate a queen and an empty space, respectively. Example…

Read More “LeetCode Hard – N-Queens” »

LEETCode

LeetCode Hard – Wildcard Matching

Posted on February 10, 2024 By allexamprep.com No Comments on LeetCode Hard – Wildcard Matching

Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for ‘?’ and ‘*’ where: The matching should cover the entire input string (not partial). Example 1:Input: s = “aa”, p = “a” Output: false Explanation: “a” does not match the entire string “aa”. Example 2:Input: s = “aa”, p = “*” Output: true Explanation: ‘*’ matches…

Read More “LeetCode Hard – Wildcard Matching” »

LEETCode

Posts pagination

Previous 1 2 3 Next

Recent Posts

  • Seminar Topic: “Adversarial Machine Learning: Challenges, Defense Mechanisms, and Real-World Implications”
  • Title: Exploring Explainable Artificial Intelligence (XAI) in Deep Learning
  • Project: Simple Weather App with OpenWeatherMap API
  • Project: Web Scraping Quotes with BeautifulSoup
  • Project: Automated Document Summarization with Gensim

Recent Comments

  1. Mystic Knightt on How to get generated id in spring batch template insert
  2. Sachin on How to get generated id in spring batch template insert

Archives

  • February 2024
  • January 2024

Categories

  • Biology
  • Blog
  • Computer QnA
  • LEETCode
  • Projects
  • Privacy Policy
  • Terms Of Service
  • Contact
  • About Us

Copyright © 2025 .

AllExamPrep