leetcode 30 days js challenge
Medium
Given two objects o1
and o2
, check if they are deeply equal.
For two objects to be deeply equal, they must contain the same keys, and the associated values must also be deeply equal. Two objects are also considered deeply equal if they pass the ===
equality check.
You may assume both objects are the output of JSON.parse
. In other words, they are valid JSON.
Please solve it without using lodash's _.isEqual()
function.
Example 1:
Example 2:
Example 3:
Example 4:
Constraints:
JSON.stringify(o1).length
<= 105JSON.stringify(o2).length
<= 105maxNestingDepth <= 1000
SheepSun, May 21, 2023