From 1376fbe0830687b0542e0001254596bf2df6c40b Mon Sep 17 00:00:00 2001 From: Deven <63876261+devenperez@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:18:00 -0500 Subject: [PATCH] Create README - LeetHub --- 2727-is-object-empty/README.md | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 2727-is-object-empty/README.md diff --git a/2727-is-object-empty/README.md b/2727-is-object-empty/README.md new file mode 100644 index 0000000..5a4ef7b --- /dev/null +++ b/2727-is-object-empty/README.md @@ -0,0 +1,44 @@ +
Given an object or an array, return if it is empty.
+ +You may assume the object or array is the output of JSON.parse.
+
Example 1:
+ +
+Input: obj = {"x": 5, "y": 42}
+Output: false
+Explanation: The object has 2 key-value pairs so it is not empty.
+
+
+Example 2:
+ +
+Input: obj = {}
+Output: true
+Explanation: The object doesn't have any key-value pairs so it is empty.
+
+
+Example 3:
+ ++Input: obj = [null, false, 0] +Output: false +Explanation: The array has 3 elements so it is not empty. ++ +
+
Constraints:
+ +obj is a valid JSON object or array2 <= JSON.stringify(obj).length <= 105+Can you solve it in O(1) time? \ No newline at end of file