We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2029f2 commit 40de8f8Copy full SHA for 40de8f8
src/test/php/com_github_leetcode/LinkedListUtils.php
@@ -6,7 +6,7 @@
6
7
class LinkedListUtils {
8
public static function constructLinkedList($nums) {
9
- if ($nums === null || count($nums) === 0) {
+ if ($nums === null || empty($nums)) {
10
return null;
11
}
12
$pre = new ListNode(-1);
@@ -20,7 +20,7 @@ public static function constructLinkedList($nums) {
20
21
22
public static function createSinglyLinkedList($listValues) {
23
- if ($listValues === null || count($listValues) === 0) {
+ if ($listValues === null || empty($listValues)) {
24
throw new InvalidArgumentException(
25
"Please pass in a valid listValues to create a singly linked list."
26
);
0 commit comments