| Felix Halim .NET | ||
|
University Experience
IOI 2002 Yong In, Korea
ACM ICPC Regional Manila 2003
ACM ICPC Regional Manila 2004
ACM ICPC Regional Manila 2005
ACM ICPC Regional Kaohsiung 2006
ACM ICPC Regional Singapore 2007
ACM ICPC World Final Tokyo 2007
Google India Code Jam 2005
Google India Code Jam 2006
Indonesia National Contest 2007
Indonesia National Contest 2008
|
||
Problem StatementYou are given a String toSort containing only '0's and '1's. Using only exchange operations, we must sort this string so every '0' comes before every '1'. Return the minimal number of exchanges necessary. DefinitionClass: Sort01 Method: shortest Parameters: String Returns: int Method signature: int shortest(String toSort) (be sure your method is public) NotesYou can exchange any two characters in the string, not just adjacent ones. Constraints
Examples0) "010" Returns: 1 The string can be sorted in one swap, exchanging the second and third characters. 1) "1100" Returns: 2 2) "00001" Returns: 0 3) "10000" Returns: 1 4) "1101010001" Returns: 3 This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved. Google India Code Jam 2006 - Table of Contents
|
||