Register
|
Login
Home
News
Competitions
Practice
How to
Rankings
Calendar
Arena
CodeFu 2010
CodeFu'10 Highlights
Jazoon'10 Highlights
Schedule
Rules
Prizes
Results
Competitions
»
Main CodeFu Competitons
»
CodeFu 2010
»
Results
CodeFu 2010 Results
Final Round Results
gella's solution for 200: TrainRoute, written in Java, submitted on 09.05.2010 12:15:51
public class TrainRoute { public static String findActualSchedule(String plannedSchedule, String updates){ StringBuffer buf=new StringBuffer(plannedSchedule); int k; for(int i=0;i<buf.length();i+=8){ if(updates.lastIndexOf(buf.charAt(i))==-1) continue; else k=updates.lastIndexOf(buf.charAt(i)); System.out.println(k); String s; if(k+7==updates.length()) s=updates.substring(k); else s=updates.substring(k, k+7); buf.replace(i, i+7, s); } return buf.toString(); } }