Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #113 from jaichiranjeeva/71
Browse files Browse the repository at this point in the history
Issue #84 : Resolve in python
  • Loading branch information
thekavikumar authored Oct 25, 2022
2 parents 2af5134 + b6c7a2c commit b05f777
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
20 changes: 20 additions & 0 deletions java/Delete_a_node.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import java.util.Scanner;

public class Delete_a_node{
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int len=in.nextInt(),l,i;
int[] list=new int[len];
int[] rem=new int[len-1];
for( i=0;i<len;i++){
list[i]=in.nextInt();
}
int rem_ind=in.nextInt();
for ( i=0, l=0;i<len;i++){
if(i!=rem_ind)
rem[l++]=list[i];
}
for(i=0;i<len-1;i++)
System.out.print(rem[i]+" ");
}
}
7 changes: 7 additions & 0 deletions python/Delete_a_node.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lim=int(input())
l=[]
while(lim):
l.append(int(input()))
lim=lim-1
l.pop(int(input()))
print(l)

0 comments on commit b05f777

Please sign in to comment.