Logo Miradil's Blog
  • Home
  • About
  • Skills
  • Experiences
  • Education
  • More
    Projects Publications Recent Posts
  • Posts
  • Dark Theme
    Light Theme Dark Theme System Theme
Logo Inverted Logo
  • Posts
  • Introduction
  • DSA
    • CodeForces
      • 1918-A: Brick Wall
    • ICPC
      • 2023
        • Azerbaijani
          • Classify The Roman Numerals
        • Nordic
          • Karl Coder
    • LeetCode
      • 2: Add Two numbers
      • 58: Length of Last Word
      • 142: Linked List Cycle II
    • Eolymp
      • 87: Robot
      • 325: Dangerous route
      • 4036 & 4038: Pre-Order/Post-Order Traversal of a Tree
      • 6254: Timebomb
    • HackerRank
      • Queen's Attack II
      • Winning Lottery Ticket
      • Balanced Brackets
  • Django
    • How to detect field changes in Django
  • Reinventing the wheel
    • Linux command: `ls`
      • Command, file types and flags
      • Starting with C
      • Getting the list of files and their info
      • Processing flags
      • Sorting and formatting the output
  • Open Source Projects
    • Integrify
  • Misc
    • How did I get into programming?
    • How I got job in two hours
  • Podcast Notes
    • The Diary of A CEO
      • Vinh Giang
Hero Image
Leetcode 142: Linked List Cycle II

NOTE: The problem 141: “Linked List Cycle” is a subproblem of this problem, so the solution can be slightly modified to solve that too. Problem statement Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail’s next pointer is connected to (0-indexed). It is -1 if there is no cycle. Note that pos is not passed as a parameter.

Monday, March 4, 2024 | 4 minutes Read
Hero Image
Leetcode 58: Length of Last Word

Problem statement Given a string s consisting of words and spaces, return the length of the last word in the string. A word is a maximal substring consisting of non-space characters only. Example 1 Input: s = "Hello World" Output: 5 Explanation: The last word is "World" with length 5. Example 2 Input: s = " fly me to the moon " Output: 4 Explanation: The last word is "moon" with length 4.

Sunday, February 11, 2024 | 3 minutes Read
Hero Image
Leetcode 2: Add Two numbers

Problem statement You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. Example 1 Input: l1 = [2,4,3], l2 = [5,6,4]

Saturday, October 7, 2023 | 3 minutes Read
Navigation
  • About
  • Skills
  • Experiences
  • Education
  • Projects
  • Publications
  • Recent Posts
Contact me:
  • [email protected]
  • mmzeynalli
  • Miradil Zeynalli
  • @mmzeynalli
  • Miradil Zeynalli
  • @mmzeynalli

Toha Theme Logo Toha
© 2024 Copyright.
Powered by Hugo Logo