Guest User

LeetCode Plagiarism biweekly 47 contest

a guest
Mar 7th, 2021
2,615
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. https://leetcode.com/190030111
  2. https://leetcode.com/SurekkaImmanni
  3. https://leetcode.com/teja2552
  4. https://leetcode.com/gullyboy118h
  5. https://leetcode.com/lokeshchalamalasetti
  6. https://leetcode.com/190030476Harshitha
  7. https://leetcode.com/190030695
  8. https://leetcode.com/190031793_BHAVANA_REDDY
  9. https://leetcode.com/190031350_PRAVALLIKA
  10. https://leetcode.com/190030803-Akshaya
  11. https://leetcode.com/MadhuKalyan_CH
  12. https://leetcode.com/shirdinadhdhulipalla
  13. https://leetcode.com/190031491
  14. https://leetcode.com/shoaib22
  15. https://leetcode.com/190030586_KLU
  16. https://leetcode.com/190031094_Naveen
  17. https://leetcode.com/190031674
  18. https://leetcode.com/sathwik190031311
  19. https://leetcode.com/190031442
  20. https://leetcode.com/190031940_samhithagatte
  21. https://leetcode.com/190030017_lokeswararao
  22. https://leetcode.com/RahulLalsingh
  23. https://leetcode.com/birukyemane
  24. https://leetcode.com/190031500_neehal
  25. https://leetcode.com/190031449
  26. https://leetcode.com/190031371
  27. https://leetcode.com/190031193
  28. https://leetcode.com/190039012
  29. https://leetcode.com/190031984_Sainikesh
  30. https://leetcode.com/190031317_Nagadeepu
  31. https://leetcode.com/190030188_vamshi
  32. https://leetcode.com/saichow
  33. https://leetcode.com/190031753_VOONNA_CHAITANYA
  34. https://leetcode.com/190030623_Yasaswini
  35. https://leetcode.com/190031011
  36. https://leetcode.com/190030664
  37. https://leetcode.com/venumaddipati
  38. https://leetcode.com/190030526_prathyushagonuguntla
  39. https://leetcode.com/190030194
  40. https://leetcode.com/190030059
  41. https://leetcode.com/190030363
  42. https://leetcode.com/190031484
  43. https://leetcode.com/190040572_Vishwak
  44. https://leetcode.com/190031328_KLU
  45. https://leetcode.com/190030155_tejaswinibetina
  46. https://leetcode.com/s07_190030644
  47. https://leetcode.com/190031315Krishnateja
  48. https://leetcode.com/190031600pravalikaThadakamalla
  49. https://leetcode.com/veda2001
  50. https://leetcode.com/190031307_klu
  51. https://leetcode.com/veda2001
  52. https://leetcode.com/190030306Pravallika
  53. https://leetcode.com/BejugamRohan
  54. https://leetcode.com/190030328_lakshmisarayu
  55. https://leetcode.com/190031903
  56. https://leetcode.com/sabbellasatyahemanthkumarreddy
  57. https://leetcode.com/190031438SAIDEEPAK
  58. https://leetcode.com/190031928
  59. https://leetcode.com/190031083_Prasad
  60. https://leetcode.com/190031672_HemanthKumar
  61. https://leetcode.com/1900300073
  62. https://leetcode.com/190030748_Ramya
  63. https://leetcode.com/khalic_190031494
  64. https://leetcode.com/190031462_SAISUSHEELGUPTAS
  65. https://leetcode.com/190031136
  66. https://leetcode.com/190030842
  67. https://leetcode.com/shyamchandra
  68. https://leetcode.com/190031467_Sreevani
  69. https://leetcode.com/shyamchandra
  70. https://leetcode.com/JangalaTejaswini
  71. https://leetcode.com/KAMINI_V_S_R_SESHADRI
  72. https://leetcode.com/31571_nagaprudhvi
  73. https://leetcode.com/Revanth_12
  74. https://leetcode.com/Siddhartha_inturu
  75. https://leetcode.com/190031078_likendhar
  76. https://leetcode.com/190031468
  77. https://leetcode.com/190030310
  78. https://leetcode.com/Tushar_Paraselli
  79. https://leetcode.com/190030977
  80. https://leetcode.com/190031504_KLU
  81. https://leetcode.com/190030225_jaswanthi
  82. https://leetcode.com/LayekSanjoy
  83. https://leetcode.com/Mohan_Srinivas_123
  84. https://leetcode.com/190031580-Tangaturuchandana
  85. https://leetcode.com/190030398_dvamsi
  86. https://leetcode.com/190031997
  87. https://leetcode.com/saisumanthreddychinthakunta
  88. https://leetcode.com/yaswanth2705
  89. https://leetcode.com/hemanthkasinadh
  90. https://leetcode.com/190031522_AvaneeshSai
  91. https://leetcode.com/190031532_nithin
  92. https://leetcode.com/ReddyChandana24
  93. https://leetcode.com/190030319
  94. https://leetcode.com/190030830
  95. https://leetcode.com/190030689
  96. https://leetcode.com/190030684jeswanthkaja
  97. https://leetcode.com/190031708
  98. https://leetcode.com/190030454__anilgadde
  99. https://leetcode.com/Pranathi_j
  100. https://leetcode.com/190030461
  101. https://leetcode.com/190031679_vyshnavi
  102.  
  103. Copied Solution -
  104.  
  105. class Solution {
  106. public int nearestValidPoint(int x, int y, int[][] points) {
  107. int n=points.length;
  108. long min=99999999,d;
  109. int ans=-1;
  110. for(int i=0;i<n;i++)
  111. {
  112. if(x==points[i][0] || y==points[i][1])
  113. {
  114. d=Math.abs(x-points[i][0])+ Math.abs(y-points[i][1]);
  115. if(d<min)
  116. {
  117. min=d;
  118. ans=i;
  119. }
  120. }
  121. }
  122. if(ans==-1)
  123. return -1;
  124. return ans;
  125. }
  126. }
  127.  
Advertisement
Add Comment
Please, Sign In to add comment