[Show all top banners]

helpjava11
Replies to this thread:

More by helpjava11
What people are reading
Subscribers
:: Subscribe
Back to: Kurakani General Refresh page to view new replies
 NEW PUZZLE for Sajha Intellects Day 6

[Please view other pages to see the rest of the postings. Total posts: 35]
PAGE: <<  1 2  
[VIEWED 16325 TIMES]
SAVE! for ease of future access.
The postings in this thread span 2 pages, go to PAGE 1.

This page is only showing last 20 replies
Posted on 06-10-14 10:08 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

q. A total of thirteen pennies is put into three piles so
that each pile has a different number of pennies.
Obviously, this can be done in several ways. Here’s the
challenge – what is the fewest possible number of
pennies in the largest pile of any of the possible
combinations?
 
The postings in this thread span 2 pages, go to PAGE 1.

This page is only showing last 20 replies
Posted on 06-10-14 3:50 PM     [Snapshot: 226]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Gabbar Singn Bro: 2 round ma game complete hudaina ni ta...
First round: remove all even numbers.
remaining numbers: 1,3,5,7,9,11....999,
secoun round: remove alternate numbers .starting at 1 again.
remaining numbers: 1, 5, 9, 13 , 17....
third round...............
 
Posted on 06-10-14 5:14 PM     [Snapshot: 294]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

After every round the total number of people is even.
Every round starts from number 1.
From the first round, when the total number of people is even and the starting number is 1, the people on both sides of 1 go out but 1 remain.
Hence, survivor = 1.
 
Posted on 06-10-14 6:20 PM     [Snapshot: 329]     Reply [Subscribe]
Login in to Rate this Post:     1       ?     Liked by
 

Perfect answer by NAS: +2

Here is my version of code:

import java.util.ArrayList;
import java.util.List;


public class jpt1 {
static int toalPeople=1000;
static int result=0;
static int x;
static int count = 1000;
public static void main(String[] args) {
List result= numberLeft(toalPeople);
System.out.println("last remaining person: "+ result);

}

static public List numberLeft(int x){
ArrayList list = new ArrayList();
for (int i = 1; i <= toalPeople; i++) {
list.add(i);

}
System.out.println("list "+list);
while(count>1){
for (int i = 0; i < list.size()-1; i++) {
list.remove(i+1);
}
System.out.println(" Remaining people : "+list.size());
count = list.size();
}
System.out.println();


return list;
}
}
Output:
Remaining people : 500
Remaining people : 250
Remaining people : 125
Remaining people : 63
Remaining people : 32
Remaining people : 16
Remaining people : 8
Remaining people : 4
Remaining people : 2
Remaining people : 1

last remaining person: [1]
 
Posted on 06-10-14 7:00 PM     [Snapshot: 351]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Niral , Obama, Fuckeeto, Gabbar Singh also answered correctly but without solution so (+1) to each.

NAS bro, ur code is awesome as well and complete with user input. Thats the way it should be. I was trying to be fast, still have 2 unnecessary variable to be cleaned up.

 
Posted on 06-10-14 10:44 PM     [Snapshot: 388]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Helpjava11, that is wrong, either your programming is wrong (i don't have knowledge about programming) or something else is wrong. If you remove every second person in a circle, it will work until there is even no. like ...1000 to 500 to 250 to 125. If you remove, 2, 4, 6.......... 998, 1000, then no. 1 will be saved. But when you come to round 4th, after you remove 124th, 125th will be saved and no. 1 will be removed. Please write the no. in the circle and do it by yourself, and you will know it :)
 
Posted on 06-11-14 7:51 AM     [Snapshot: 454]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

La Ram dai - here is the result

Remaining people : 1000
Removig people: Round 1
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 176 178 180 182 184 186 188 190 192 194 196 198 200 202 204 206 208 210 212 214 216 218 220 222 224 226 228 230 232 234 236 238 240 242 244 246 248 250 252 254 256 258 260 262 264 266 268 270 272 274 276 278 280 282 284 286 288 290 292 294 296 298 300 302 304 306 308 310 312 314 316 318 320 322 324 326 328 330 332 334 336 338 340 342 344 346 348 350 352 354 356 358 360 362 364 366 368 370 372 374 376 378 380 382 384 386 388 390 392 394 396 398 400 402 404 406 408 410 412 414 416 418 420 422 424 426 428 430 432 434 436 438 440 442 444 446 448 450 452 454 456 458 460 462 464 466 468 470 472 474 476 478 480 482 484 486 488 490 492 494 496 498 500 502 504 506 508 510 512 514 516 518 520 522 524 526 528 530 532 534 536 538 540 542 544 546 548 550 552 554 556 558 560 562 564 566 568 570 572 574 576 578 580 582 584 586 588 590 592 594 596 598 600 602 604 606 608 610 612 614 616 618 620 622 624 626 628 630 632 634 636 638 640 642 644 646 648 650 652 654 656 658 660 662 664 666 668 670 672 674 676 678 680 682 684 686 688 690 692 694 696 698 700 702 704 706 708 710 712 714 716 718 720 722 724 726 728 730 732 734 736 738 740 742 744 746 748 750 752 754 756 758 760 762 764 766 768 770 772 774 776 778 780 782 784 786 788 790 792 794 796 798 800 802 804 806 808 810 812 814 816 818 820 822 824 826 828 830 832 834 836 838 840 842 844 846 848 850 852 854 856 858 860 862 864 866 868 870 872 874 876 878 880 882 884 886 888 890 892 894 896 898 900 902 904 906 908 910 912 914 916 918 920 922 924 926 928 930 932 934 936 938 940 942 944 946 948 950 952 954 956 958 960 962 964 966 968 970 972 974 976 978 980 982 984 986 988 990 992 994 996 998 1000

Remaining people : 500
Removig people: Round 2
3 7 11 15 19 23 27 31 35 39 43 47 51 55 59 63 67 71 75 79 83 87 91 95 99 103 107 111 115 119 123 127 131 135 139 143 147 151 155 159 163 167 171 175 179 183 187 191 195 199 203 207 211 215 219 223 227 231 235 239 243 247 251 255 259 263 267 271 275 279 283 287 291 295 299 303 307 311 315 319 323 327 331 335 339 343 347 351 355 359 363 367 371 375 379 383 387 391 395 399 403 407 411 415 419 423 427 431 435 439 443 447 451 455 459 463 467 471 475 479 483 487 491 495 499 503 507 511 515 519 523 527 531 535 539 543 547 551 555 559 563 567 571 575 579 583 587 591 595 599 603 607 611 615 619 623 627 631 635 639 643 647 651 655 659 663 667 671 675 679 683 687 691 695 699 703 707 711 715 719 723 727 731 735 739 743 747 751 755 759 763 767 771 775 779 783 787 791 795 799 803 807 811 815 819 823 827 831 835 839 843 847 851 855 859 863 867 871 875 879 883 887 891 895 899 903 907 911 915 919 923 927 931 935 939 943 947 951 955 959 963 967 971 975 979 983 987 991 995 999

Remaining people : 250
Removig people: Round 3
5 13 21 29 37 45 53 61 69 77 85 93 101 109 117 125 133 141 149 157 165 173 181 189 197 205 213 221 229 237 245 253 261 269 277 285 293 301 309 317 325 333 341 349 357 365 373 381 389 397 405 413 421 429 437 445 453 461 469 477 485 493 501 509 517 525 533 541 549 557 565 573 581 589 597 605 613 621 629 637 645 653 661 669 677 685 693 701 709 717 725 733 741 749 757 765 773 781 789 797 805 813 821 829 837 845 853 861 869 877 885 893 901 909 917 925 933 941 949 957 965 973 981 989 997

Remaining people : 125
Removig people: Round 4
9 25 41 57 73 89 105 121 137 153 169 185 201 217 233 249 265 281 297 313 329 345 361 377 393 409 425 441 457 473 489 505 521 537 553 569 585 601 617 633 649 665 681 697 713 729 745 761 777 793 809 825 841 857 873 889 905 921 937 953 969 985

Remaining people : 63
Removig people: Round 5
17 49 81 113 145 177 209 241 273 305 337 369 401 433 465 497 529 561 593 625 657 689 721 753 785 817 849 881 913 945 977

Remaining people : 32
Removig people: Round 6
33 97 161 225 289 353 417 481 545 609 673 737 801 865 929 993

Remaining people : 16
Removig people: Round 8
65 193 321 449 577 705 833 961

Remaining people : 8
Removig people: Round 9
129 385 641 897

Remaining people : 4
Removig people: Round 10
257 769

Remaining people : 2
Removig people: Round 11
513

Remaining people : 1
last remaining person: 1
 
Posted on 06-11-14 8:03 AM     [Snapshot: 452]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

RamroNepal bro, there is a good possibility I might be wrong. coz I didnt looked at the answer when I posted the question.
Can you post your resoning with what answer you got.

 
Posted on 06-11-14 8:30 AM     [Snapshot: 470]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Couple of observations:

1. RamroNepal, I am afraid you are wrong. Serial has already listed all the numbers that get eliminated and showed that 1 survives. Let's think about it logically. You are suppose to take the second number out that survived. What happens is when you go round, you start eliminating every other numbers and then end at the highest number left. Then you start your count again from 1 and eliminate the second number. You see, 1 always comes as the first number during these iterations and survives every single time until the end.

2. I am very impressed with Helpjava and Nas' programming skills. This is a very simple programming, but I know lots of people working in IT as developer cannot write this simple code. They lie on their resume and force things up. It is not too hard to learn programming. If you are considering a career in IT, specifically as a programmer or developer, please learn the basic programming. I like how both of them have used the correct logic sequence and indented the code to make it easy to read. I am sure if they had more time, they'd have added some comments next to the critical functions. Impressed.
 
Posted on 06-11-14 8:39 AM     [Snapshot: 481]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

why to write so long?
just use python:
lll = range(1, 1001, 1) # list of 1000 numbers
i= 0
rr = 1 # round
while 1:
if i+1 < len(lll):
del lll[i+1]
elif i+1 > len(lll):
print "round ", rr
print "remaining ", lll
i = len(lll) - i -1
rr = rr+1
elif len(lll) == 1:
break
i = i+1
Results:
round 1
remaining [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255, 257, 259, 261, 263, 265, 267, 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, 289, 291, 293, 295, 297, 299, 301, 303, 305, 307, 309, 311, 313, 315, 317, 319, 321, 323, 325, 327, 329, 331, 333, 335, 337, 339, 341, 343, 345, 347, 349, 351, 353, 355, 357, 359, 361, 363, 365, 367, 369, 371, 373, 375, 377, 379, 381, 383, 385, 387, 389, 391, 393, 395, 397, 399, 401, 403, 405, 407, 409, 411, 413, 415, 417, 419, 421, 423, 425, 427, 429, 431, 433, 435, 437, 439, 441, 443, 445, 447, 449, 451, 453, 455, 457, 459, 461, 463, 465, 467, 469, 471, 473, 475, 477, 479, 481, 483, 485, 487, 489, 491, 493, 495, 497, 499, 501, 503, 505, 507, 509, 511, 513, 515, 517, 519, 521, 523, 525, 527, 529, 531, 533, 535, 537, 539, 541, 543, 545, 547, 549, 551, 553, 555, 557, 559, 561, 563, 565, 567, 569, 571, 573, 575, 577, 579, 581, 583, 585, 587, 589, 591, 593, 595, 597, 599, 601, 603, 605, 607, 609, 611, 613, 615, 617, 619, 621, 623, 625, 627, 629, 631, 633, 635, 637, 639, 641, 643, 645, 647, 649, 651, 653, 655, 657, 659, 661, 663, 665, 667, 669, 671, 673, 675, 677, 679, 681, 683, 685, 687, 689, 691, 693, 695, 697, 699, 701, 703, 705, 707, 709, 711, 713, 715, 717, 719, 721, 723, 725, 727, 729, 731, 733, 735, 737, 739, 741, 743, 745, 747, 749, 751, 753, 755, 757, 759, 761, 763, 765, 767, 769, 771, 773, 775, 777, 779, 781, 783, 785, 787, 789, 791, 793, 795, 797, 799, 801, 803, 805, 807, 809, 811, 813, 815, 817, 819, 821, 823, 825, 827, 829, 831, 833, 835, 837, 839, 841, 843, 845, 847, 849, 851, 853, 855, 857, 859, 861, 863, 865, 867, 869, 871, 873, 875, 877, 879, 881, 883, 885, 887, 889, 891, 893, 895, 897, 899, 901, 903, 905, 907, 909, 911, 913, 915, 917, 919, 921, 923, 925, 927, 929, 931, 933, 935, 937, 939, 941, 943, 945, 947, 949, 951, 953, 955, 957, 959, 961, 963, 965, 967, 969, 971, 973, 975, 977, 979, 981, 983, 985, 987, 989, 991, 993, 995, 997, 999]
round 2
remaining [1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 169, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 233, 237, 241, 245, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293, 297, 301, 305, 309, 313, 317, 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 365, 369, 373, 377, 381, 385, 389, 393, 397, 401, 405, 409, 413, 417, 421, 425, 429, 433, 437, 441, 445, 449, 453, 457, 461, 465, 469, 473, 477, 481, 485, 489, 493, 497, 501, 505, 509, 513, 517, 521, 525, 529, 533, 537, 541, 545, 549, 553, 557, 561, 565, 569, 573, 577, 581, 585, 589, 593, 597, 601, 605, 609, 613, 617, 621, 625, 629, 633, 637, 641, 645, 649, 653, 657, 661, 665, 669, 673, 677, 681, 685, 689, 693, 697, 701, 705, 709, 713, 717, 721, 725, 729, 733, 737, 741, 745, 749, 753, 757, 761, 765, 769, 773, 777, 781, 785, 789, 793, 797, 801, 805, 809, 813, 817, 821, 825, 829, 833, 837, 841, 845, 849, 853, 857, 861, 865, 869, 873, 877, 881, 885, 889, 893, 897, 901, 905, 909, 913, 917, 921, 925, 929, 933, 937, 941, 945, 949, 953, 957, 961, 965, 969, 973, 977, 981, 985, 989, 993, 997]
round 3
remaining [1, 9, 17, 25, 33, 41, 49, 57, 65, 73, 81, 89, 97, 105, 113, 121, 129, 137, 145, 153, 161, 169, 177, 185, 193, 201, 209, 217, 225, 233, 241, 249, 257, 265, 273, 281, 289, 297, 305, 313, 321, 329, 337, 345, 353, 361, 369, 377, 385, 393, 401, 409, 417, 425, 433, 441, 449, 457, 465, 473, 481, 489, 497, 505, 513, 521, 529, 537, 545, 553, 561, 569, 577, 585, 593, 601, 609, 617, 625, 633, 641, 649, 657, 665, 673, 681, 689, 697, 705, 713, 721, 729, 737, 745, 753, 761, 769, 777, 785, 793, 801, 809, 817, 825, 833, 841, 849, 857, 865, 873, 881, 889, 897, 905, 913, 921, 929, 937, 945, 953, 961, 969, 977, 985, 993]
round 4
remaining [1, 17, 33, 49, 65, 81, 97, 113, 129, 145, 161, 177, 193, 209, 225, 241, 257, 273, 289, 305, 321, 337, 353, 369, 385, 401, 417, 433, 449, 465, 481, 497, 513, 529, 545, 561, 577, 593, 609, 625, 641, 657, 673, 689, 705, 721, 737, 753, 769, 785, 801, 817, 833, 849, 865, 881, 897, 913, 929, 945, 961, 977, 993]
round 5
remaining [1, 33, 65, 97, 129, 161, 193, 225, 257, 289, 321, 353, 385, 417, 449, 481, 513, 545, 577, 609, 641, 673, 705, 737, 769, 801, 833, 865, 897, 929, 961, 993]
round 6
remaining [1, 65, 129, 193, 257, 321, 385, 449, 513, 577, 641, 705, 769, 833, 897, 961]
round 7
remaining [1, 129, 257, 385, 513, 641, 769, 897]
round 8
remaining [1, 257, 513, 769]
round 9
remaining [1, 513]
round 10
remaining [1]

 
Posted on 06-11-14 9:26 AM     [Snapshot: 505]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Sabai programme ma khariyeka boka haru rahechan :), aafulai ta programming ko kehi ni knowledge chaina :( tara sojho tarika le herda ajhai yo program ma kehi galat cha.

Lets go to paradox's program :

In round 3 :

Remaining no. are : .....................945, 953, 961, 969, 977, 985, 993

If it is a circle, it will be

.......945, 953, 961, 969, 977, 985, 993, 1, 9, 17, 25 ......


Now in round 4 you will remove 953, 969, 985, 1, 17 ...... so on. So no. 1 should remove if it is a circle. But your programming always start with no.1 as it is not a circle.

Sabai no. paperma lekher ni dekhaune koshis gardachu time bhayo bhane sanibar samma maa, jamma 2000 jati no. Lekhna parne ta rahecha ni :)


Programming garda kehi logic chutyo jasto laagyo hai malai, khoi k ho k .



 
Posted on 06-11-14 9:57 AM     [Snapshot: 520]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

RamroNepal bro ko kura pani thik ho. logically 1 should have been removed.
java ले धोका दियो जस्तो छ .
Programmer साथी भाई, एकपल्ट फेरि सोच्न पर्यो .

 
Posted on 06-11-14 10:25 AM     [Snapshot: 520]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

sorry i am actually wrong.
 
Posted on 06-11-14 11:12 AM     [Snapshot: 588]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 


Hope this correct,
public class Node
{
private int value;
private Node nextNode;
private Node prevNode;

public void setValue(final int value)
{
this.value = value;
}
public void setNextNode(final Node nextNode)
{
this.nextNode = nextNode;
}

public void setPrevNode(final Node prevNode)
{
this.prevNode = prevNode;
}
public int getValue()
{
return value;
}
public Node getNextNode()
{
return nextNode;
}

public Node getPrevNode()
{
return prevNode;
}
}


public class LastNumberCheck
{
public Node findLastStandingNumber()
{
Node node = setUpData();
int personToRemove = 1;
System.out.println("Removed values: ");
do
{
personToRemove = 1 - personToRemove;
if (personToRemove == 1)
{
removeNode(node);
System.out.print(node.getValue() + ", ");
}
node = node.getNextNode();
}
while (node.getNextNode() != node);
System.out.println("Remaining value" + node.getValue());

return node;
}

private Node setUpData()
{

Node prevNode = new Node();
prevNode.setValue(1);
Node firstNode = prevNode;
Node lastNode = null;
for (int index = 2; index <= 1000; index ++)
{
Node node = new Node();
node.setValue(index);
node.setPrevNode(prevNode);
prevNode.setNextNode(node);
prevNode = node;
lastNode = node;
}
firstNode.setPrevNode(lastNode);
lastNode.setNextNode(firstNode);
return firstNode;
}

private void removeNode(final Node node)
{
Node previousNode = node.getPrevNode();
Node nextNode = node.getNextNode();
previousNode.setNextNode(nextNode);
nextNode.setPrevNode(previousNode);
}
}

Output:
Removed values:
2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, 300, 302, 304, 306, 308, 310, 312, 314, 316, 318, 320, 322, 324, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344, 346, 348, 350, 352, 354, 356, 358, 360, 362, 364, 366, 368, 370, 372, 374, 376, 378, 380, 382, 384, 386, 388, 390, 392, 394, 396, 398, 400, 402, 404, 406, 408, 410, 412, 414, 416, 418, 420, 422, 424, 426, 428, 430, 432, 434, 436, 438, 440, 442, 444, 446, 448, 450, 452, 454, 456, 458, 460, 462, 464, 466, 468, 470, 472, 474, 476, 478, 480, 482, 484, 486, 488, 490, 492, 494, 496, 498, 500, 502, 504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, 526, 528, 530, 532, 534, 536, 538, 540, 542, 544, 546, 548, 550, 552, 554, 556, 558, 560, 562, 564, 566, 568, 570, 572, 574, 576, 578, 580, 582, 584, 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, 606, 608, 610, 612, 614, 616, 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, 638, 640, 642, 644, 646, 648, 650, 652, 654, 656, 658, 660, 662, 664, 666, 668, 670, 672, 674, 676, 678, 680, 682, 684, 686, 688, 690, 692, 694, 696, 698, 700, 702, 704, 706, 708, 710, 712, 714, 716, 718, 720, 722, 724, 726, 728, 730, 732, 734, 736, 738, 740, 742, 744, 746, 748, 750, 752, 754, 756, 758, 760, 762, 764, 766, 768, 770, 772, 774, 776, 778, 780, 782, 784, 786, 788, 790, 792, 794, 796, 798, 800, 802, 804, 806, 808, 810, 812, 814, 816, 818, 820, 822, 824, 826, 828, 830, 832, 834, 836, 838, 840, 842, 844, 846, 848, 850, 852, 854, 856, 858, 860, 862, 864, 866, 868, 870, 872, 874, 876, 878, 880, 882, 884, 886, 888, 890, 892, 894, 896, 898, 900, 902, 904, 906, 908, 910, 912, 914, 916, 918, 920, 922, 924, 926, 928, 930, 932, 934, 936, 938, 940, 942, 944, 946, 948, 950, 952, 954, 956, 958, 960, 962, 964, 966, 968, 970, 972, 974, 976, 978, 980, 982, 984, 986, 988, 990, 992, 994, 996, 998, 1000, 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, 99, 103, 107, 111, 115, 119, 123, 127, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239, 243, 247, 251, 255, 259, 263, 267, 271, 275, 279, 283, 287, 291, 295, 299, 303, 307, 311, 315, 319, 323, 327, 331, 335, 339, 343, 347, 351, 355, 359, 363, 367, 371, 375, 379, 383, 387, 391, 395, 399, 403, 407, 411, 415, 419, 423, 427, 431, 435, 439, 443, 447, 451, 455, 459, 463, 467, 471, 475, 479, 483, 487, 491, 495, 499, 503, 507, 511, 515, 519, 523, 527, 531, 535, 539, 543, 547, 551, 555, 559, 563, 567, 571, 575, 579, 583, 587, 591, 595, 599, 603, 607, 611, 615, 619, 623, 627, 631, 635, 639, 643, 647, 651, 655, 659, 663, 667, 671, 675, 679, 683, 687, 691, 695, 699, 703, 707, 711, 715, 719, 723, 727, 731, 735, 739, 743, 747, 751, 755, 759, 763, 767, 771, 775, 779, 783, 787, 791, 795, 799, 803, 807, 811, 815, 819, 823, 827, 831, 835, 839, 843, 847, 851, 855, 859, 863, 867, 871, 875, 879, 883, 887, 891, 895, 899, 903, 907, 911, 915, 919, 923, 927, 931, 935, 939, 943, 947, 951, 955, 959, 963, 967, 971, 975, 979, 983, 987, 991, 995, 999, 5, 13, 21, 29, 37, 45, 53, 61, 69, 77, 85, 93, 101, 109, 117, 125, 133, 141, 149, 157, 165, 173, 181, 189, 197, 205, 213, 221, 229, 237, 245, 253, 261, 269, 277, 285, 293, 301, 309, 317, 325, 333, 341, 349, 357, 365, 373, 381, 389, 397, 405, 413, 421, 429, 437, 445, 453, 461, 469, 477, 485, 493, 501, 509, 517, 525, 533, 541, 549, 557, 565, 573, 581, 589, 597, 605, 613, 621, 629, 637, 645, 653, 661, 669, 677, 685, 693, 701, 709, 717, 725, 733, 741, 749, 757, 765, 773, 781, 789, 797, 805, 813, 821, 829, 837, 845, 853, 861, 869, 877, 885, 893, 901, 909, 917, 925, 933, 941, 949, 957, 965, 973, 981, 989, 997, 9, 25, 41, 57, 73, 89, 105, 121, 137, 153, 169, 185, 201, 217, 233, 249, 265, 281, 297, 313, 329, 345, 361, 377, 393, 409, 425, 441, 457, 473, 489, 505, 521, 537, 553, 569, 585, 601, 617, 633, 649, 665, 681, 697, 713, 729, 745, 761, 777, 793, 809, 825, 841, 857, 873, 889, 905, 921, 937, 953, 969, 985, 1, 33, 65, 97, 129, 161, 193, 225, 257, 289, 321, 353, 385, 417, 449, 481, 513, 545, 577, 609, 641, 673, 705, 737, 769, 801, 833, 865, 897, 929, 961, 993, 49, 113, 177, 241, 305, 369, 433, 497, 561, 625, 689, 753, 817, 881, 945, 17, 145, 273, 401, 529, 657, 785, 913, 81, 337, 593, 849, 209, 721, 465, Remaining value977

 
Posted on 06-11-14 11:39 AM     [Snapshot: 608]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Prankster le nikalecha la answer. Mero no. milyo,, lu gaam paam ta :) dui din bhayo duita gaam paayincha hola hai :)
 
Posted on 06-11-14 11:45 AM     [Snapshot: 614]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

एक से एक छन् साझा मा. यो चै मान्ने पर्ने हो. Bravo RamroNepal bro.
 
Posted on 06-11-14 11:45 AM     [Snapshot: 630]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

ramroNepal = faster than super computer, you should be a Dev Manager:P
 
Posted on 06-11-14 11:45 AM     [Snapshot: 615]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

I got the same answer as prankster : 977

import java.util.ArrayList;
import java.util.List;

public class HelloWorld{

public static void main(String []args){
removeNumbers();
}

public static void removeNumbers() {

ArrayList list = new ArrayList();
for (int i = 1; i <= 1000; i++) {
list.add(i);
}

int listSize = 1000;
int n =0;
int lastRemoved = 0;
while(listSize > 1) {
System.out.println();
System.out.println("Removed ");
for (int i = n; i < list.size()-1; i++) {
lastRemoved = list.get(i+1);
System.out.print(lastRemoved + " ");
list.remove(i+1);
}

System.out.println();
System.out.println("Remaining ");
for (int i = 0; i < list.size(); i++) {
System.out.print(list.get(i) + " ");
}

if(lastRemoved < list.get(list.size()-1)) {
n=-1;
} else {
n=0;
}

listSize = list.size();
}
System.out.println("Last Number "+list.get(0));
}
}


Removed
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 176 178 180 182 184 186 188 190 192 194 196 198 200 202 204 206 208 210 212 214 216 218 220 222 224 226 228 230 232 234 236 238 240 242 244 246 248 250 252 254 256 258 260 262 264 266 268 270 272 274 276 278 280 282 284 286 288 290 292 294 296 298 300 302 304 306 308 310 312 314 316 318 320 322 324 326 328 330 332 334 336 338 340 342 344 346 348 350 352 354 356 358 360 362 364 366 368 370 372 374 376 378 380 382 384 386 388 390 392 394 396 398 400 402 404 406 408 410 412 414 416 418 420 422 424 426 428 430 432 434 436 438 440 442 444 446 448 450 452 454 456 458 460 462 464 466 468 470 472 474 476 478 480 482 484 486 488 490 492 494 496 498 500 502 504 506 508 510 512 514 516 518 520 522 524 526 528 530 532 534 536 538 540 542 544 546 548 550 552 554 556 558 560 562 564 566 568 570 572 574 576 578 580 582 584 586 588 590 592 594 596 598 600 602 604 606 608 610 612 614 616 618 620 622 624 626 628 630 632 634 636 638 640 642 644 646 648 650 652 654 656 658 660 662 664 666 668 670 672 674 676 678 680 682 684 686 688 690 692 694 696 698 700 702 704 706 708 710 712 714 716 718 720 722 724 726 728 730 732 734 736 738 740 742 744 746 748 750 752 754 756 758 760 762 764 766 768 770 772 774 776 778 780 782 784 786 788 790 792 794 796 798 800 802 804 806 808 810 812 814 816 818 820 822 824 826 828 830 832 834 836 838 840 842 844 846 848 850 852 854 856 858 860 862 864 866 868 870 872 874 876 878 880 882 884 886 888 890 892 894 896 898 900 902 904 906 908 910 912 914 916 918 920 922 924 926 928 930 932 934 936 938 940 942 944 946 948 950 952 954 956 958 960 962 964 966 968 970 972 974 976 978 980 982 984 986 988 990 992 994 996 998 1000
Remaining
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 175 177 179 181 183 185 187 189 191 193 195 197 199 201 203 205 207 209 211 213 215 217 219 221 223 225 227 229 231 233 235 237 239 241 243 245 247 249 251 253 255 257 259 261 263 265 267 269 271 273 275 277 279 281 283 285 287 289 291 293 295 297 299 301 303 305 307 309 311 313 315 317 319 321 323 325 327 329 331 333 335 337 339 341 343 345 347 349 351 353 355 357 359 361 363 365 367 369 371 373 375 377 379 381 383 385 387 389 391 393 395 397 399 401 403 405 407 409 411 413 415 417 419 421 423 425 427 429 431 433 435 437 439 441 443 445 447 449 451 453 455 457 459 461 463 465 467 469 471 473 475 477 479 481 483 485 487 489 491 493 495 497 499 501 503 505 507 509 511 513 515 517 519 521 523 525 527 529 531 533 535 537 539 541 543 545 547 549 551 553 555 557 559 561 563 565 567 569 571 573 575 577 579 581 583 585 587 589 591 593 595 597 599 601 603 605 607 609 611 613 615 617 619 621 623 625 627 629 631 633 635 637 639 641 643 645 647 649 651 653 655 657 659 661 663 665 667 669 671 673 675 677 679 681 683 685 687 689 691 693 695 697 699 701 703 705 707 709 711 713 715 717 719 721 723 725 727 729 731 733 735 737 739 741 743 745 747 749 751 753 755 757 759 761 763 765 767 769 771 773 775 777 779 781 783 785 787 789 791 793 795 797 799 801 803 805 807 809 811 813 815 817 819 821 823 825 827 829 831 833 835 837 839 841 843 845 847 849 851 853 855 857 859 861 863 865 867 869 871 873 875 877 879 881 883 885 887 889 891 893 895 897 899 901 903 905 907 909 911 913 915 917 919 921 923 925 927 929 931 933 935 937 939 941 943 945 947 949 951 953 955 957 959 961 963 965 967 969 971 973 975 977 979 981 983 985 987 989 991 993 995 997 999
Removed
3 7 11 15 19 23 27 31 35 39 43 47 51 55 59 63 67 71 75 79 83 87 91 95 99 103 107 111 115 119 123 127 131 135 139 143 147 151 155 159 163 167 171 175 179 183 187 191 195 199 203 207 211 215 219 223 227 231 235 239 243 247 251 255 259 263 267 271 275 279 283 287 291 295 299 303 307 311 315 319 323 327 331 335 339 343 347 351 355 359 363 367 371 375 379 383 387 391 395 399 403 407 411 415 419 423 427 431 435 439 443 447 451 455 459 463 467 471 475 479 483 487 491 495 499 503 507 511 515 519 523 527 531 535 539 543 547 551 555 559 563 567 571 575 579 583 587 591 595 599 603 607 611 615 619 623 627 631 635 639 643 647 651 655 659 663 667 671 675 679 683 687 691 695 699 703 707 711 715 719 723 727 731 735 739 743 747 751 755 759 763 767 771 775 779 783 787 791 795 799 803 807 811 815 819 823 827 831 835 839 843 847 851 855 859 863 867 871 875 879 883 887 891 895 899 903 907 911 915 919 923 927 931 935 939 943 947 951 955 959 963 967 971 975 979 983 987 991 995 999
Remaining
1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97 101 105 109 113 117 121 125 129 133 137 141 145 149 153 157 161 165 169 173 177 181 185 189 193 197 201 205 209 213 217 221 225 229 233 237 241 245 249 253 257 261 265 269 273 277 281 285 289 293 297 301 305 309 313 317 321 325 329 333 337 341 345 349 353 357 361 365 369 373 377 381 385 389 393 397 401 405 409 413 417 421 425 429 433 437 441 445 449 453 457 461 465 469 473 477 481 485 489 493 497 501 505 509 513 517 521 525 529 533 537 541 545 549 553 557 561 565 569 573 577 581 585 589 593 597 601 605 609 613 617 621 625 629 633 637 641 645 649 653 657 661 665 669 673 677 681 685 689 693 697 701 705 709 713 717 721 725 729 733 737 741 745 749 753 757 761 765 769 773 777 781 785 789 793 797 801 805 809 813 817 821 825 829 833 837 841 845 849 853 857 861 865 869 873 877 881 885 889 893 897 901 905 909 913 917 921 925 929 933 937 941 945 949 953 957 961 965 969 973 977 981 985 989 993 997
Removed
5 13 21 29 37 45 53 61 69 77 85 93 101 109 117 125 133 141 149 157 165 173 181 189 197 205 213 221 229 237 245 253 261 269 277 285 293 301 309 317 325 333 341 349 357 365 373 381 389 397 405 413 421 429 437 445 453 461 469 477 485 493 501 509 517 525 533 541 549 557 565 573 581 589 597 605 613 621 629 637 645 653 661 669 677 685 693 701 709 717 725 733 741 749 757 765 773 781 789 797 805 813 821 829 837 845 853 861 869 877 885 893 901 909 917 925 933 941 949 957 965 973 981 989 997
Remaining
1 9 17 25 33 41 49 57 65 73 81 89 97 105 113 121 129 137 145 153 161 169 177 185 193 201 209 217 225 233 241 249 257 265 273 281 289 297 305 313 321 329 337 345 353 361 369 377 385 393 401 409 417 425 433 441 449 457 465 473 481 489 497 505 513 521 529 537 545 553 561 569 577 585 593 601 609 617 625 633 641 649 657 665 673 681 689 697 705 713 721 729 737 745 753 761 769 777 785 793 801 809 817 825 833 841 849 857 865 873 881 889 897 905 913 921 929 937 945 953 961 969 977 985 993
Removed
9 25 41 57 73 89 105 121 137 153 169 185 201 217 233 249 265 281 297 313 329 345 361 377 393 409 425 441 457 473 489 505 521 537 553 569 585 601 617 633 649 665 681 697 713 729 745 761 777 793 809 825 841 857 873 889 905 921 937 953 969 985
Remaining
1 17 33 49 65 81 97 113 129 145 161 177 193 209 225 241 257 273 289 305 321 337 353 369 385 401 417 433 449 465 481 497 513 529 545 561 577 593 609 625 641 657 673 689 705 721 737 753 769 785 801 817 833 849 865 881 897 913 929 945 961 977 993
Removed
1 33 65 97 129 161 193 225 257 289 321 353 385 417 449 481 513 545 577 609 641 673 705 737 769 801 833 865 897 929 961 993
Remaining
17 49 81 113 145 177 209 241 273 305 337 369 401 433 465 497 529 561 593 625 657 689 721 753 785 817 849 881 913 945 977
Removed
49 113 177 241 305 369 433 497 561 625 689 753 817 881 945
Remaining
17 81 145 209 273 337 401 465 529 593 657 721 785 849 913 977
Removed
17 145 273 401 529 657 785 913
Remaining
81 209 337 465 593 721 849 977
Removed
81 337 593 849
Remaining
209 465 721 977
Removed
209 721
Remaining
465 977
Removed
465
Remaining
977

Last Number 977
 
Posted on 06-11-14 11:48 AM     [Snapshot: 619]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

हिजो दिएको points सब फिर्ता है :
Niral , Obama, Fuckeeto
नास (-२)
gabbar singh bro ko answer (977) thyo hijo so (+1-1=0)
प्रन्क्स्टर ब्रो & राम्रो नेपाल ब्रो को answer मिल्यो जस्तो छ . can anybody else verify?
 
Posted on 06-11-14 11:59 AM     [Snapshot: 660]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

You can just look at the output and verify?
 
Posted on 06-11-14 3:28 PM     [Snapshot: 719]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

प्रन्क्स्टर ब्रो & राम्रो नेपाल ब्रो (+2)
 



PAGE: <<  1 2  
Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 60 days
Recommended Popular Threads Controvertial Threads
शीर्षक जे पनि हुन सक्छ।
NRN card pros and cons?
What are your first memories of when Nepal Television Began?
Basnet or Basnyat ??
nrn citizenship
Sajha has turned into MAGATs nest
Nas and The Bokas: Coming to a Night Club near you
डीभी परेन भने खुसि हुनु होस् ! अमेरिकामाधेरै का श्रीमती अर्कैसँग पोइला गएका छन् !
3 most corrupt politicians in the world
if you are in USA illegally and ask for asylum it is legal
Top 10 Anti-vaxxers Who Got Owned by COVID
निगुरो थाहा छ ??
Poonam pandey - death or suicide?
ढ्याउ गर्दा दसैँको खसी गनाउच
Doctors dying suddenly or unexpectedly since the rollout of COVID-19 vaccines
काेराेना सङ्क्रमणबाट बच्न Immunity बढाउन के के खाने ?How to increase immunity against COVID - 19?
Travelling to Nepal - TPS AP- PASSPORT
TPS Work Permit/How long your took?
How long does Citizenship take?
Will MAGA really start shooting people?
Nas and The Bokas: Coming to a Night Club near you
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters