liubinzhe
BAN USER
RepJesseDavis, Animator at 8x8
Hey I am Jack from us. I am working as a professor in MIT university.i Love my profession and ...
Repshivanojasy, Apple Phone Number available 24/7 for our Customers at A9
Dedicated worker with a following of regular customers and an understanding of sales and marketing.During my time away from ...
RepJanetCKeel, Accountant at ABC TECH SUPPORT
Hey i am Janet i am from Us and i leave here from last 4 years .My job is truck ...
RepElkeRoll, Animator at A9
I am Elke from the USA. I am working as a technologist in Hill-Behan company. I perform and analyze the ...
Repaileenpankney, photographer at Precious Moments
Confident and dedicated photographer with experience in both professional and freelance photography. I like to explore Black Magic Spell To ...
Repirmajrichh, Junior programmer at AppNexus
I am Irma, seeking the position of a Historical Researcher at Littler’s where my expertise can be utilized to ...
Repmarygaustria, Analyst at ADP
I am Mary from Los Angeles, USA. I am working as a Manager in Fragrant Flower Lawn Services company. I ...
RepAdaShipman, abc at 247quickbookshelp
During operation, determine all necessary adjustments to the printing press to maintain safety, quality and productivity standards and make such ...
RepHannahWilson, Android Engineer at A9
Hi, I’m Hannah from the USA and I am working as an account manager. I work for a hardware ...
RepLauraJOles, Android Engineer at A9
Hi i am Laura.I live in Us from my childhood and i love my country.My father he is ...
RepI am Risk managers that advise organizations on any potential risks to the profitability, safety, security or existence of the ...
Repselindareese, Animator at Agilent Technologies
I am Selinda a Music teacher and composer with 6+ years of experience with an in depth knowledge of music ...
RepHelenBMartin, Android Engineer at ABC TECH SUPPORT
I am an avid reader and a leader and participant in a community book club. My reading Kamakhya Mandir Tantrik ...
RepRuzilStaker, Java Freshers at Digital Merkating
Ruzil , a Publicity Specialist with over four years in PR. Also a communicator adept at managing all public relations efforts ...
RepPaulMahone, Android test engineer at Booking.com
Hey, my name is Jazzy and I am a Journalist as a profession.I started my journey from last 4 ...
Repannawellson007, Area Sales Manager at 8x8
Hey my name is anna And i am working as a content writer in Search engine optimization company.My component ...
Repivaharvie, Production Engineer at BMO Harris Bank
Je suis Iva, professeur de musique et compositeur avec plus de 6 ans d'expérience avec une connaissance approfondie de ...
Repbradybally973, Computer Scientist at AMD
I am a network administrator. I live in Washington USA .My responsibility includes maintaining computer infrastructures with emphasis on local ...
Repamayahoyle, Associate at ABC TECH SUPPORT
Working as a Set Designer with 2+ years of experience in Audio Aid for vehicles and props including turns using ...
Repjacksssones433, Apple Phone Number available 24/7 for our Customers at A9
Proficient and creative WordPress developer with a strong history in website management and development. Experienced in SEO and PPC campaign ...
Rephazelwlson80, abc at A9
I am a skilled civil engineer with many years of experience in a variety of engineering aspects. There are a ...
Repshirleyjbarker439, Animator at ASAPInfosystemsPvtLtd
Hello, I am Gladys. I am a Industrial Photographer. I started off my photographic career as a News photographer based ...
RepAadavThomas, abc at A9
I am a well skilled and innovative Industrial Designer who focuses on taking products, noting product ideas and making them ...
Repbrakpeter2, AT&T Customer service email at Absolute Softech Ltd
My Profession Is photography for a number of years.My Friends were interested in photography, so I was always exposed ...
Repleliakelsch6389, Associate at 247quickbookshelp
Hello, I am a News Anchor. And I have completed all my studies from Portland. And today I am a ...
RepDavidTBevins, Apple Phone Number available 24/7 for our Customers at AMD
Hi am working as a writer and i wrote many books.Mostly i write books related to Magic and my ...
Repshinchunigo, Benefits clerk at Good Times
Votaw, Top Duties and Qualifications Benefits clerk . It is responsible for performing administrative tasks to support daily business operations. My ...
Rephizahula, abc at 8x8
I am Erica and have lived in the US for the last 4 years.I did my degree in the ...
RepMaryCParker, Dev Lead at ADP
My name is Mary and I am from usa.I am a representative sales advertising agent of (Specific Appraisals)company ...
RepGiannaDavid, Author at The times
I am an Author, I have a passion for reading and creative writing and attend many workshops and conventions surrounding ...
RepBrezaLoni, Health inspector at Chess King
I am Health inspector from Memphis, USA .My work involves inspecting restaurants, schools, public pools, nursing homes, and daycare centres ...
Repmoruytmeks, Airport service agent at Stratabiz
I am an airport service agent . I work in an airport , providing information and assistance to the flying public. In ...
Repzippy28943, Data Scientist at AppNexus
Maxine , a grant writer specializing in researching and analysing grant opportunities, creating funding plans, and conducting proposals and budgets. Last ...
public static void main(String[] args) {
- liubinzhe March 18, 2013String str = "986561517416921217551395112859219257312";
getEqualSumSubString(str);
}
public static void getEqualSumSubString(String str){
int len = str.length();
int i = len;
if(len%2 != 0){
i--;
}
int count = 0;
String firstSub = str.substring(0, i/2);
String lastSub = str.substring(i/2, i);
int firstSum = getSum(firstSub, i/2);
int lastSum = getSum(lastSub, i/2);
while(true){
if(firstSum == lastSum){
System.out.println(i);
return;
}else if(i >= 2){
if((count + i) <= len){
firstSub = str.substring(count, count+i/2);
lastSub = str.substring(count+i/2, count+i);
firstSum = getSum(firstSub, i/2);
lastSum = getSum(lastSub, i/2);
//System.out.println(i + " | " + count + " | " + firstSum + " | " + lastSum);
count++;
}
else{
i-=2;
count = 0;
}
}else{
System.out.println("0");
return;
}
}
}
public static int getSum(String str, int len){
int sum = 0;
for(int i = 0; i < len; i++){
sum += (str.charAt(i) - 48);
}
return sum;
}