Please Help Me

Dec 24, 2014
16
1
3
Panadura
Please help me Guys... :( Mekata podi help 1k denna puluwan kenek innawada?

Write methods (return type void) for each problem given below which take an array with 10000 integers (data type: int) as the input parameter and print expected output. The array is virtually broken into chunks of similar length and length of the chuck defined in the related question (given below). Items within a chunk are sorted in descending order. Your methods should print the starting index and the sum of the chunk which has maximum sum of its elements. If there are more than one chunk with maximum sum, very first applicable chunk should be taken as the solution. You are going to address a very specific problem (eg: number of elements in the array is fixed, chuck sizes are pre-defined) so your solution is NOT required to be a generic solution which works for any input.

i) Print starting index and sum of the chunk which has maximum sum of its elements when the chunk size is 100.
ii) If you think that you can come up with a higher optimized solution when the chunk size is 1000, write another method to print starting index and sum of its elements which has maximum sum among other chunks.
iii) If you think you have a better optimized solution if the chunk size is 10000, write an optimized method to print starting index of relevant chunk and its sum.

Here are some examples:

• In problem (i), if the chunk starting from 300 has the sum of 100000 and 100000 is the maximum sum among other chunks, and then you should print a similar text as following text.
“ Starting index : 300”
“ Sum of chunk : 100000”

• In problem (ii), if the chunk starting from 3000 has the sum of 1000000 and 1000000 is the maximum sum among other chunks, and then you should print a similar text as following text.
“ Starting index : 3000”
“ Sum of chunk : 1000000”
 
Last edited:
Dec 24, 2014
16
1
3
Panadura
Please help me Guys... :( Mekata podi help 1k denna puluwan kenek innawada?

Write methods (return type void) for each problem given below which take an array with 10000 integers (data type: int) as the input parameter and print expected output. The array is virtually broken into chunks of similar length and length of the chuck defined in the related question (given below). Items within a chunk are sorted in descending order. Your methods should print the starting index and the sum of the chunk which has maximum sum of its elements. If there are more than one chunk with maximum sum, very first applicable chunk should be taken as the solution. You are going to address a very specific problem (eg: number of elements in the array is fixed, chuck sizes are pre-defined) so your solution is NOT required to be a generic solution which works for any input.

i) Print starting index and sum of the chunk which has maximum sum of its elements when the chunk size is 100.
ii) If you think that you can come up with a higher optimized solution when the chunk size is 1000, write another method to print starting index and sum of its elements which has maximum sum among other chunks.
iii) If you think you have a better optimized solution if the chunk size is 10000, write an optimized method to print starting index of relevant chunk and its sum.

Here are some examples:

• In problem (i), if the chunk starting from 300 has the sum of 100000 and 100000 is the maximum sum among other chunks, and then you should print a similar text as following text.
“ Starting index : 300”
“ Sum of chunk : 100000”

• In problem (ii), if the chunk starting from 3000 has the sum of 1000000 and 1000000 is the maximum sum among other chunks, and then you should print a similar text as following text.
“ Starting index : 3000”
“ Sum of chunk : 1000000”


C# walin
 
Nov 24, 2014
789
64
0
තියෙනවා.. ඒක ප්‍රසිද්ධියේ කියන්න බෑනේ :)

එහෙනං චන්දෙ කියන්න බැරි එකෙක්ටම කියල උදව් ගනිං. කියන්න බැරි මයිත්රී කොටියට දෙන නිසානෙ. මයිත්රීට චන්දෙ දෙන එකෙක් මැරෙන්න වැටිල පන ඇද ඇද හිටියත් එක වතුර උගුරක් දෙන්නෑ.
 
Please help me Guys... :( Mekata podi help 1k denna puluwan kenek innawada?

Write methods (return type void) for each problem given below which take an array with 10000 integers (data type: int) as the input parameter and print expected output. The array is virtually broken into chunks of similar length and length of the chuck defined in the related question (given below). Items within a chunk are sorted in descending order. Your methods should print the starting index and the sum of the chunk which has maximum sum of its elements. If there are more than one chunk with maximum sum, very first applicable chunk should be taken as the solution. You are going to address a very specific problem (eg: number of elements in the array is fixed, chuck sizes are pre-defined) so your solution is NOT required to be a generic solution which works for any input.

i) Print starting index and sum of the chunk which has maximum sum of its elements when the chunk size is 100.
ii) If you think that you can come up with a higher optimized solution when the chunk size is 1000, write another method to print starting index and sum of its elements which has maximum sum among other chunks.
iii) If you think you have a better optimized solution if the chunk size is 10000, write an optimized method to print starting index of relevant chunk and its sum.

Here are some examples:

• In problem (i), if the chunk starting from 300 has the sum of 100000 and 100000 is the maximum sum among other chunks, and then you should print a similar text as following text.
“ Starting index : 300”
“ Sum of chunk : 100000”

• In problem (ii), if the chunk starting from 3000 has the sum of 1000000 and 1000000 is the maximum sum among other chunks, and then you should print a similar text as following text.
“ Starting index : 3000”
“ Sum of chunk : 1000000”

මේක assignment එකක්ද බැරිවෙලාවත්? ඉස්සෙල ප්‍රශ්නෙ තේරුම් ගන්න තමා වැදගත්


මේ කියන integer array එක මේ වගේ


0=12, 1=9, 2=34, 3=25,... 99=12, // එක chunk එකක්, sum = (12 + 9 + 34 + 25 + ...... + 12)
100=3, 101=5, 102=33,...... 199=10 // තව chunk එකක්, sum = (3 + 5 + 33 + .... + 10)
....
9900=45,9901=56,...... 9999=15 // අන්තිම එක


sum එක වැඩිම එක දෙවැනි එක නම් index එක 100 යි, sum එකයි ලිව්වහම හරි


void Sum(int[] a)
{
for (int i = 0; i < a.Length/100; i++)
{
for (int j = i; j < 100; j++)
{
// දැන් chunk එකේ එකතුව අරන් තව array එකකට දා ගන්න
}
}
// දැන් sum array එකේ උපරිමය හොයන්න
}
(මමනම් චන්දෙ රාජපක්ෂට විරුද්ධව :) )
 
Last edited:
Dec 24, 2014
16
1
3
Panadura
Please help me Guys... :( Mekata podi help 1k denna puluwan kenek innawada?

Write methods (return type void) for each problem given below which take an array with 10000 integers (data type: int) as the input parameter and print expected output. The array is virtually broken into chunks of similar length and length of the chuck defined in the related question (given below). Items within a chunk are sorted in descending order. Your methods should print the starting index and the sum of the chunk which has maximum sum of its elements. If there are more than one chunk with maximum sum, very first applicable chunk should be taken as the solution. You are going to address a very specific problem (eg: number of elements in the array is fixed, chuck sizes are pre-defined) so your solution is NOT required to be a generic solution which works for any input.

i) Print starting index and sum of the chunk which has maximum sum of its elements when the chunk size is 100.
ii) If you think that you can come up with a higher optimized solution when the chunk size is 1000, write another method to print starting index and sum of its elements which has maximum sum among other chunks.
iii) If you think you have a better optimized solution if the chunk size is 10000, write an optimized method to print starting index of relevant chunk and its sum.

Here are some examples:

• In problem (i), if the chunk starting from 300 has the sum of 100000 and 100000 is the maximum sum among other chunks, and then you should print a similar text as following text.
“ Starting index : 300”
“ Sum of chunk : 100000”

• In problem (ii), if the chunk starting from 3000 has the sum of 1000000 and 1000000 is the maximum sum among other chunks, and then you should print a similar text as following text.
“ Starting index : 3000”
“ Sum of chunk : 1000000”



ඔව් assignment එකක්.. බොහොම ස්තුතියි, ලොකු උදව්වක් කලේ :)
 
Dec 24, 2014
16
1
3
Panadura
මේක assignment එකක්ද බැරිවෙලාවත්? ඉස්සෙල ප්‍රශ්නෙ තේරුම් ගන්න තමා වැදගත්


මේ කියන integer array එක මේ වගේ


0=12, 1=9, 2=34, 3=25,... 99=12, // එක chunk එකක්, sum = (12 + 9 + 34 + 25 + ...... + 12)
100=3, 101=5, 102=33,...... 199=10 // තව chunk එකක්, sum = (3 + 5 + 33 + .... + 10)
....
9900=45,9901=56,...... 9999=15 // අන්තිම එක


sum එක වැඩිම එක දෙවැනි එක නම් index එක 100 යි, sum එකයි ලිව්වහම හරි


void Sum(int[] a)
{
for (int i = 0; i < a.Length/100; i++)
{
for (int j = i; j < 100; j++)
{
// දැන් chunk එකේ එකතුව අරන් තව array එකකට දා ගන්න
}
}
// දැන් sum array එකේ උපරිමය හොයන්න
}
(මමනම් චන්දෙ රාජපක්ෂට විරුද්ධව :) )




ඔව් assignment එකක්.. බොහොම ස්තුතියි,ලොකු උදව්වක් කලේ.. :) ;)
 
Last edited:
Dec 24, 2014
16
1
3
Panadura
එහෙනං චන්දෙ කියන්න බැරි එකෙක්ටම කියල උදව් ගනිං. කියන්න බැරි මයිත්රී කොටියට දෙන නිසානෙ. මයිත්රීට චන්දෙ දෙන එකෙක් මැරෙන්න වැටිල පන ඇද ඇද හිටියත් එක වතුර උගුරක් දෙන්නෑ.



මහින්දට චන්දේ දෙන කෙනා දේශප්‍රේමියා, මහින්දට චන්දේ නොදෙන කෙනා දේශද්‍රෝහියා කියලා කොහේද ලියලා තියෙන්නේ... :) මගේ පළවෙනි චන්දේ දුන්නේ මහින්දට​...එදා මම ගත්ත තීරණේ හරි මොකද මහින්ද යුද්දේ ඉවරකලා

මහින්ද විතරද යුද්දේ ඉවර කලේ? නෑ තවගොඩක් අය හිටියා... අපේ ආමි එකේ අයියලා ජීවිත පූජාකරලා, අත​,පය නැති කරන් රටට සාමය ගෙනාවට අද වෙනකල් ඇහුණද යුද්දේ ඉවරකලේ ඒගොල්ලෝ කියලා... මිනිස්සුන්ට අමතකයි, මිනිස්සුන්ට මතක මහින්ද විතරයි...ඒකත් කමක් නෑ කියමු... එක්කෙනෙක් විතරක් ලකුණු දාගන්න එක සාධාරණ නෑනේ... එහෙම කලා කියලා හැම පාරම මහින්දට දෙන්න ඕනද​? මහින්ද 4වෙනි පාරටත් චන්දේ ඉල්ලුවොත් ඒ පාරත් අපි එයාට​ චන්දේ දෙන්න ඕනද​? මට ඔය දේශපාලකයෝ කවුරුත් එකයි... දේශපාලකයෝ කාගෙත් වැරදි තියෙනවා.... මම චන්දේ දෙනවා නම් ආයේ පසුතැවෙන්න චන්දේ දෙන්නේ නෑ, දෙන එක හොඳට හිතලයි දෙන්නේ... ඕන කෙනෙක්ට තමන්ට කැමති දේශපාලන මතයක් දරන්න පුළුවන්...
 
Last edited:
Nov 24, 2014
789
64
0
මහින්දට චන්දේ දෙන කෙනා දේශප්‍රේමියා, මහින්දට චන්දේ නොදෙන කෙනා දේශද්‍රෝහියා කියලා කොහේද ලියලා තියෙන්නේ... :) මගේ පළවෙනි චන්දේ දුන්නේ මහින්දට​...එදා මම ගත්ත තීරණේ හරි මොකද මහින්ද යුද්දේ ඉවරකලා

මහින්ද විතරද යුද්දේ ඉවර කලේ? නෑ තවගොඩක් අය හිටියා... අපේ ආමි එකේ අයියලා ජීවිත පූජාකරලා, අත​,පය නැති කරන් රටට සාමය ගෙනාවට අද වෙනකල් ඇහුණද යුද්දේ ඉවරකලේ ඒගොල්ලෝ කියලා... මිනිස්සුන්ට අමතකයි, මිනිස්සුන්ට මතක මහින්ද විතරයි...ඒකත් කමක් නෑ කියමු... එක්කෙනෙක් විතරක් ලකුණු දාගන්න එක සාධාරණ නෑනේ... එහෙම කලා කියලා හැම පාරම මහින්දට දෙන්න ඕනද​? මහින්ද 4වෙනි පාරටත් චන්දේ ඉල්ලුවොත් ඒ පාරත් අපි එයාට​ චන්දේ දෙන්න ඕනද​? මට ඔය දේශපාලකයෝ කවුරුත් එකයි... දේශපාලකයෝ කාගෙත් වැරදි තියෙනවා.... මම චන්දේ දෙනවා නම් ආයේ පසුතැවෙන්න චන්දේ දෙන්නේ නෑ, දෙන එක හොඳට හිතලයි දෙන්නේ... ඕන කෙනෙක්ට තමන්ට කැමති දේශපාලන මතයක් දරන්න පුළුවන්...

මයිත්රීගෙ කටකතා වලට රැවටුනු තවත් එක් චන්ද දායකයෙක්.
හමුදාව යුද්දෙ ඉවර කලා නම් මහින්ද සර් ජනාදිපතිවෙන්න කලින් හමුදාව හිටියෙ නැද්ද ? ඇයි මහින්ද සර් පත්වෙන්න කලින් ඔය මිනිස්සුන්ට ජීවිත පූජා කල්ල රට බේරගන්න තිබ්බෙ නැත්තෙ ? දෙකයි පනහෙ ගොං තර්ක දාන්න එපා. යුද්දෙ ඉවර කලේ මහින්ද රාජපක්ශ ජනාදිපතිතුමා තමා. ඒක පිලිගන්න අකමැති ද්රෝහියො විතරයි. මයිත්රීපාල වටේ ඉන්නෙ. බටහිර එන් ජී ඕ සංවිදාන වලිං ඩොලර් කුට්ටි ගනං ලැබෙන්නෙ. අන්න උන්. පසුතැවෙන්න චන්දෙ දෙන්නෑ කියල මයිත්රීපාලට චන්දෙ දීල පසුතැවෙන්න වෙන එකක් නෑ කියල හොදටම විශ්වාසද ? මයිත්රීපාල දින්නොත් ප්රබාකරන්වත් නොකල තරමේ විනාශයක් ලංකාවට වෙනව.
 
මේක තමා හේතු ඵල වාදය කියන්නෙ:

හේතුව:


එහෙනං චන්දෙ කියන්න බැරි එකෙක්ටම කියල උදව් ගනිං. කියන්න බැරි මයිත්රී කොටියට දෙන නිසානෙ. මයිත්රීට චන්දෙ දෙන එකෙක් මැරෙන්න වැටිල පන ඇද ඇද හිටියත් එක වතුර උගුරක් දෙන්නෑ.


ඵලය:


මහින්දට චන්දේ දෙන කෙනා දේශප්‍රේමියා, මහින්දට චන්දේ නොදෙන කෙනා දේශද්‍රෝහියා කියලා කොහේද ලියලා තියෙන්නේ... :) මගේ පළවෙනි චන්දේ දුන්නේ මහින්දට​...එදා මම ගත්ත තීරණේ හරි මොකද මහින්ද යුද්දේ ඉවරකලා

මහින්ද විතරද යුද්දේ ඉවර කලේ? නෑ තවගොඩක් අය හිටියා... අපේ ආමි එකේ අයියලා ජීවිත පූජාකරලා, අත​,පය නැති කරන් රටට සාමය ගෙනාවට අද වෙනකල් ඇහුණද යුද්දේ ඉවරකලේ ඒගොල්ලෝ කියලා... මිනිස්සුන්ට අමතකයි, මිනිස්සුන්ට මතක මහින්ද විතරයි...ඒකත් කමක් නෑ කියමු... එක්කෙනෙක් විතරක් ලකුණු දාගන්න එක සාධාරණ නෑනේ... එහෙම කලා කියලා හැම පාරම මහින්දට දෙන්න ඕනද​? මහින්ද 4වෙනි පාරටත් චන්දේ ඉල්ලුවොත් ඒ පාරත් අපි එයාට​ චන්දේ දෙන්න ඕනද​? මට ඔය දේශපාලකයෝ කවුරුත් එකයි... දේශපාලකයෝ කාගෙත් වැරදි තියෙනවා.... මම චන්දේ දෙනවා නම් ආයේ පසුතැවෙන්න චන්දේ දෙන්නේ නෑ, දෙන එක හොඳට හිතලයි දෙන්නේ... ඕන කෙනෙක්ට තමන්ට කැමති දේශපාලන මතයක් දරන්න පුළුවන්...

දේශපාලනයට අදාළ නැති අහක යන කෙනෙකුගෙ චන්දෙත් තර්ජන දාන්ඩ ගිහින් නැතිකරගත්ත. :D
 
Dec 24, 2014
16
1
3
Panadura
මයිත්රීගෙ කටකතා වලට රැවටුනු තවත් එක් චන්ද දායකයෙක්.
හමුදාව යුද්දෙ ඉවර කලා නම් මහින්ද සර් ජනාදිපතිවෙන්න කලින් හමුදාව හිටියෙ නැද්ද ? ඇයි මහින්ද සර් පත්වෙන්න කලින් ඔය මිනිස්සුන්ට ජීවිත පූජා කල්ල රට බේරගන්න තිබ්බෙ නැත්තෙ ? දෙකයි පනහෙ ගොං තර්ක දාන්න එපා. යුද්දෙ ඉවර කලේ මහින්ද රාජපක්ශ ජනාදිපතිතුමා තමා. ඒක පිලිගන්න අකමැති ද්රෝහියො විතරයි. මයිත්රීපාල වටේ ඉන්නෙ. බටහිර එන් ජී ඕ සංවිදාන වලිං ඩොලර් කුට්ටි ගනං ලැබෙන්නෙ. අන්න උන්. පසුතැවෙන්න චන්දෙ දෙන්නෑ කියල මයිත්රීපාලට චන්දෙ දීල පසුතැවෙන්න වෙන එකක් නෑ කියල හොදටම විශ්වාසද ? මයිත්රීපාල දින්නොත් ප්රබාකරන්වත් නොකල තරමේ විනාශයක් ලංකාවට වෙනව.



නිර්පාක්ශිකයෙකු වීමේ වාසිය මොකක්ද දන්නවද​?
1) වෙන කෙනෙකුට ඔබේ ආකල්ප පාලනය කරන්නට ඉඩදීමට අවශ්‍ය නොවීමයි..
2) ඕනෑම දෙයක් දිහා බුද්ධිමත්ව සිතා බැලීමට හැකිවීමයි...
3) හදවතට නොව බුද්ධියට තීරණගන්නට ඉඩ ලබාදිය හැකිවීමයි...


ජනතාව විසින් මේ අවස්ථාවේ කලයුත්තේ, දැනට ඇති විකල්ප වලින් වඩා හොඳ විකල්පය තෝරාගැනීමයි... මට නම් කාටවත් කඩේ යන්න ඕන කමක් නෑ... ඒත් කියන්න ඕනදේ ඔන්න කෙලින්ම කිව්වා... මේක මහින්දගේ විතරක් නෙවි පක්ශ​, විපක්ශ අපි හැමෝගේම රට​...
 
Last edited:

A. සිරියා

Awrudu Games 2017 - Winners
  • මේක assignment එකක්ද බැරිවෙලාවත්? ඉස්සෙල ප්‍රශ්නෙ තේරුම් ගන්න තමා වැදගත්


    මේ කියන integer array එක මේ වගේ


    0=12, 1=9, 2=34, 3=25,... 99=12, // එක chunk එකක්, sum = (12 + 9 + 34 + 25 + ...... + 12)
    100=3, 101=5, 102=33,...... 199=10 // තව chunk එකක්, sum = (3 + 5 + 33 + .... + 10)
    ....
    9900=45,9901=56,...... 9999=15 // අන්තිම එක


    sum එක වැඩිම එක දෙවැනි එක නම් index එක 100 යි, sum එකයි ලිව්වහම හරි


    void Sum(int[] a)
    {
    for (int i = 0; i < a.Length/100; i++)
    {
    for (int j = i; j < 100; j++)
    {
    // දැන් chunk එකේ එකතුව අරන් තව array එකකට දා ගන්න
    }
    }
    // දැන් sum array එකේ උපරිමය හොයන්න
    }
    (මමනම් චන්දෙ රාජපක්ෂට විරුද්ධව :) )

    ela kiri kollek :yes: