Maximum Marked Indices
You have an array of integers represented by nums. Initially, none of the indices are marked. You can perform the following operation as many times as needed:
Select two distinct unmarked indices i and j such that the value at index i is less than or equal to half the value at index j, then mark both indices i and j.
Print the maximum number of indices you can mark by applying this operation any number of times.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)