Skip to content
logo
Read more about the article Reverse Linked List | Leetcode 206

Reverse Linked List | Leetcode 206

  • Post author:Anam
  • Post published:May 3, 2023
  • Post category:Leetcode/Python

Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: Input: head = [1,2,3,4,5] Output: [5,4,3,2,1] Example 2: Input: head = [1,2] Output: [2,1] Example…

Continue ReadingReverse Linked List | Leetcode 206
Read more about the article Check if Linked List has a Cycle | Linked List Cycle | Leetcode 141

Check if Linked List has a Cycle | Linked List Cycle | Leetcode 141

  • Post author:Anam
  • Post published:May 2, 2023
  • Post category:Leetcode/Python

Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked list if there is some node…

Continue ReadingCheck if Linked List has a Cycle | Linked List Cycle | Leetcode 141
Read more about the article Remove nth node from end of list | Python | Leetcode 19

Remove nth node from end of list | Python | Leetcode 19

  • Post author:Anam
  • Post published:May 2, 2023
  • Post category:Leetcode/Python

Given the head of a linked list, remove the nth node from the end of the list and return its head. Example 1: Input: head = [1,2,3,4,5], n = 2 Output: [1,2,3,5] Example 2:…

Continue ReadingRemove nth node from end of list | Python | Leetcode 19
Read more about the article Check If A Number Is Power Of Two | Python | Leetcode 231

Check If A Number Is Power Of Two | Python | Leetcode 231

  • Post author:Anam
  • Post published:April 11, 2023
  • Post category:Leetcode

Question Given an integer n, return true if it is a power of two. Otherwise, return false. An integer n is a power of two, if there exists an integer x such that n == 2x. Example 1: Input:…

Continue ReadingCheck If A Number Is Power Of Two | Python | Leetcode 231
Read more about the article Number of Days Between Two Dates | Python | Leetcode 1360

Number of Days Between Two Dates | Python | Leetcode 1360

  • Post author:Anam
  • Post published:April 10, 2023
  • Post category:Leetcode

Question Write a program to count the number of days between two dates. The two dates are given as strings, their format is YYYY-MM-DD as shown in the examples. Example 1: Input:…

Continue ReadingNumber of Days Between Two Dates | Python | Leetcode 1360
Copyright - OceanWP Theme by OceanWP