Learn DSADSAContests
coding75 logo
LeetCode POTDPOTDSheets
coding75 Pro
coding75 logo
Dashboard
Learn DSA
Course RoadmapFlow
DSA Topic TreeNew πŸš€
Contest SolutionsPractice
Practice Sheets
MasterclassesLive πŸ‘¨πŸ»β€πŸ’»

coding75 ProPRO

Live Classes & Placement Guidance

coding75 logo

The premier developer platform for mastering Data Structures & Algorithms, exploring contest editorials, building ATS-ready resumes, and accelerating your tech career.

Connect & Community

DSA & Contests

  • Learn DSA
  • Contest Solutions
  • LeetCode POTDDaily
  • Practice Sheets
  • MasterclassesSoon

Interview Prep

  • Portfolio Projects
  • CS Fundamentals
  • System DesignSoon
  • Interview ExperiencesSoon
  • Mock InterviewsSoon

Career & Pro

  • Jobs & Internships
  • Resume BuilderATS
  • coding75 Pro
  • Submit Feedback
Β© 2026coding75β€’crackDSAβ„’β€’Maa Lalita Edtech Private Limited. All Rights Reserved.
Privacy PolicyTerms & ConditionsContact Support
Registered Office: Kanpur 208021β€’Regional Office: Indiranagar, Bangalore, 560008
Maa Lalita Edtech Private Limited
Contests/LeetCode/Weekly Contest 500/3920. Maximize Fixed Points After Deletions
Prev
LeetCodeLeetCode
Hard
Weekly Contest 500

3920. Maximize Fixed Points After Deletions

Dynamic ProgrammingArrayBinary SearchSorting
Loading...
Solve on LeetCode

Problem Statement

Official algorithmic problem description and constraints.

Open on LeetCode

You are given an integer array nums.

A position i is called a fixed point if nums[i] == i.

You are allowed to delete any number of elements (including zero) from the array. After each deletion, the remaining elements shift left, and indices are reassigned starting from 0.

Return an integer denoting the maximum number of fixed points that can be achieved after performing any number of deletions.

 

Example 1:

Input: nums = [0,2,1]

Output: 2

Explanation:

  • Delete nums[1] = 2. The array becomes [0, 1].
  • Now, nums[0] = 0 and nums[1] = 1, so both indices are fixed points.
  • Thus, the answer is 2.

Example 2:

Input: nums = [3,1,2]

Output: 2

Explanation:

  • Do not delete any elements. The array remains [3, 1, 2].
  • Here, nums[1] = 1 and nums[2] = 2, so these indices are fixed points.
  • Thus, the answer is 2.

Example 3:

Input: nums = [1,0,1,2]

Output: 3

Explanation:

  • Delete nums[0] = 1. The array becomes [0, 1, 2].
  • Now, nums[0] = 0, nums[1] = 1, and nums[2] = 2, so all indices are fixed points.
  • Thus, the answer is 3.

 

Constraints:

  • 1 <= nums.length <= 105
  • 0 <= nums[i] <= 105


Solutions & Walkthrough

Detailed video explanations, mathematical intuition, and clean C++ implementation code.

Connecting secure classroom stream...
Back to Weekly Contest 500
Previous Problem