Skip to content

Commit

Permalink
solution of leetcode 2089 problem
Browse files Browse the repository at this point in the history
  • Loading branch information
welli7ngton committed May 25, 2024
1 parent 3ee7a75 commit fcd1537
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Leetcode: 2089. Find Target Indices After Sorting Array
def targetIndices(nums, target):
nums.sort()
result = []
for i in range(len(nums)):
if nums[i] == target:
result.append(i)
return result


if __name__ == '__main__':
print(targetIndices([1, 2, 5, 2, 3], 2))
print(targetIndices([1, 2, 5, 2, 3], 3))
print(targetIndices([1, 2, 5, 2, 3], 5))

0 comments on commit fcd1537

Please sign in to comment.