Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Post
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Reply
How to do this type of insert in 2d array in python?
Pruthvi Patel
7 years ago
255
Reply
I have 2D array where y is sorted and unique.so insert operation should be based on y.
x
y
0.012
396.470
0.017
401.480
0.028
406.490
0.032
411.500
0.038
416.510
0.043
421.520
0.046
426.530
0.051
431.540
0.050
436.540
0.050
441.550
and now i have another inputed2darray
0.030
408.505
0.043
421.520
0.050
430.050
0.047
438.540
then output array should be like this
x
y
0.012
396.470
0.017
410.480
0.028
406.490
0.030
408.505
0.032
411.500
0.038
416.510
0.043
421.520
0.046
426.530
0.050
430.050
0.051
431.540
0.050
436.540
0.047
438.540
0.050
441.550
and also return the index of inserted and non inserted(if the element is present in the list then not insert) element
outputindexarr=[3,6,8,11]
yellow highlighted:was not present in the given 2d array so it was inserted in the outputarray
green highlighted: was present in the given 2d array so it was inserted in the outputarray.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
how to create admin account.
Read column wise in csv file using java