We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f47800 commit aca4191Copy full SHA for aca4191
1 file changed
kotlin/0027-remove-element.kt
@@ -0,0 +1,13 @@
1
+class Solution {
2
+ fun removeElement(nums: IntArray, `val`: Int): Int {
3
+ var pointer = 0
4
+ for(n in nums){
5
+ if(n != `val`){
6
+ nums[pointer] = n
7
+ pointer++
8
+ }
9
10
+ return pointer
11
12
+
13
+}
0 commit comments