Solved! Leetcode 2352. Equal Row and Column Pairs

source: https://leetcode.com/problems/equal-row-and-column-pairs/description/ Equal Row and Column Pairs Description Given a 0-indexed n x n integer matrix grid, return the number of pairs (ri, cj) such that row ri and column cj are equal. A row and column pair are considered equal if they contain the same elements in the same order (i.e., an equal array). ...

Leetcode 1056: Confusing Number

A confusing number is a number that, when rotated 180 degrees, becomes a different number with each digit valid. We can rotate the digits of a number by 180 degrees to form new digits. When 0, 1, 6, 8, and 9 are rotated 180 degrees, they become 0, 1, 9, 8, and 6, respectively.When 2, ...

Leetcode 290: Word Pattern

Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in s. https://leetcode.com/problems/word-pattern/ class Solution { public boolean wordPattern(String pattern, String s) { String[] sArr = s.split(" "); Map<Character, String> map = new HashMap<>(); char[] pArr = pattern.toCharArray(); //if the length of ...