From c0f00b0a3aec0125331bf3b8f85ed74ae34fb44b Mon Sep 17 00:00:00 2001
From: krahets
Date: Thu, 10 Nov 2022 04:00:10 +0800
Subject: [PATCH 01/23] Update LICENSE and README.
---
LICENSE.md | 488 ++++++++++++++++++++++++++++++++++++++++-------------
README.md | 10 +-
2 files changed, 377 insertions(+), 121 deletions(-)
diff --git a/LICENSE.md b/LICENSE.md
index d379d94..3b7b82d 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,173 +1,427 @@
-# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
+Attribution-ShareAlike 4.0 International
+
+=======================================================================
+
+Creative Commons Corporation ("Creative Commons") is not a law firm and
+does not provide legal services or legal advice. Distribution of
+Creative Commons public licenses does not create a lawyer-client or
+other relationship. Creative Commons makes its licenses and related
+information available on an "as-is" basis. Creative Commons gives no
+warranties regarding its licenses, any material licensed under their
+terms and conditions, or any related information. Creative Commons
+disclaims all liability for damages resulting from their use to the
+fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and
+conditions that creators and other rights holders may use to share
+original works of authorship and other material subject to copyright
+and certain other rights specified in the public license below. The
+following considerations are for informational purposes only, are not
+exhaustive, and do not form part of our licenses.
+
+ Considerations for licensors: Our public licenses are
+ intended for use by those authorized to give the public
+ permission to use material in ways otherwise restricted by
+ copyright and certain other rights. Our licenses are
+ irrevocable. Licensors should read and understand the terms
+ and conditions of the license they choose before applying it.
+ Licensors should also secure all rights necessary before
+ applying our licenses so that the public can reuse the
+ material as expected. Licensors should clearly mark any
+ material not subject to the license. This includes other CC-
+ licensed material, or material used under an exception or
+ limitation to copyright. More considerations for licensors:
+ wiki.creativecommons.org/Considerations_for_licensors
+
+ Considerations for the public: By using one of our public
+ licenses, a licensor grants the public permission to use the
+ licensed material under specified terms and conditions. If
+ the licensor's permission is not necessary for any reason--for
+ example, because of any applicable exception or limitation to
+ copyright--then that use is not regulated by the license. Our
+ licenses grant only permissions under copyright and certain
+ other rights that a licensor has authority to grant. Use of
+ the licensed material may still be restricted for other
+ reasons, including because others have copyright or other
+ rights in the material. A licensor may make special requests,
+ such as asking that all changes be marked or described.
+ Although not required by our licenses, you are encouraged to
+ respect those requests where reasonable. More_considerations
+ for the public:
+ wiki.creativecommons.org/Considerations_for_licensees
+
+=======================================================================
+
+Creative Commons Attribution-ShareAlike 4.0 International Public
+License
+
+By exercising the Licensed Rights (defined below), You accept and agree
+to be bound by the terms and conditions of this Creative Commons
+Attribution-ShareAlike 4.0 International Public License ("Public
+License"). To the extent this Public License may be interpreted as a
+contract, You are granted the Licensed Rights in consideration of Your
+acceptance of these terms and conditions, and the Licensor grants You
+such rights in consideration of benefits the Licensor receives from
+making the Licensed Material available under these terms and
+conditions.
+
+
+Section 1 -- Definitions.
+
+ a. Adapted Material means material subject to Copyright and Similar
+ Rights that is derived from or based upon the Licensed Material
+ and in which the Licensed Material is translated, altered,
+ arranged, transformed, or otherwise modified in a manner requiring
+ permission under the Copyright and Similar Rights held by the
+ Licensor. For purposes of this Public License, where the Licensed
+ Material is a musical work, performance, or sound recording,
+ Adapted Material is always produced where the Licensed Material is
+ synched in timed relation with a moving image.
+
+ b. Adapter's License means the license You apply to Your Copyright
+ and Similar Rights in Your contributions to Adapted Material in
+ accordance with the terms and conditions of this Public License.
+
+ c. BY-SA Compatible License means a license listed at
+ creativecommons.org/compatiblelicenses, approved by Creative
+ Commons as essentially the equivalent of this Public License.
+
+ d. Copyright and Similar Rights means copyright and/or similar rights
+ closely related to copyright including, without limitation,
+ performance, broadcast, sound recording, and Sui Generis Database
+ Rights, without regard to how the rights are labeled or
+ categorized. For purposes of this Public License, the rights
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
+ Rights.
+
+ e. Effective Technological Measures means those measures that, in the
+ absence of proper authority, may not be circumvented under laws
+ fulfilling obligations under Article 11 of the WIPO Copyright
+ Treaty adopted on December 20, 1996, and/or similar international
+ agreements.
+
+ f. Exceptions and Limitations means fair use, fair dealing, and/or
+ any other exception or limitation to Copyright and Similar Rights
+ that applies to Your use of the Licensed Material.
+
+ g. License Elements means the license attributes listed in the name
+ of a Creative Commons Public License. The License Elements of this
+ Public License are Attribution and ShareAlike.
+
+ h. Licensed Material means the artistic or literary work, database,
+ or other material to which the Licensor applied this Public
+ License.
+
+ i. Licensed Rights means the rights granted to You subject to the
+ terms and conditions of this Public License, which are limited to
+ all Copyright and Similar Rights that apply to Your use of the
+ Licensed Material and that the Licensor has authority to license.
+
+ j. Licensor means the individual(s) or entity(ies) granting rights
+ under this Public License.
+
+ k. Share means to provide material to the public by any means or
+ process that requires permission under the Licensed Rights, such
+ as reproduction, public display, public performance, distribution,
+ dissemination, communication, or importation, and to make material
+ available to the public including in ways that members of the
+ public may access the material from a place and at a time
+ individually chosen by them.
+
+ l. Sui Generis Database Rights means rights other than copyright
+ resulting from Directive 96/9/EC of the European Parliament and of
+ the Council of 11 March 1996 on the legal protection of databases,
+ as amended and/or succeeded, as well as other essentially
+ equivalent rights anywhere in the world.
+
+ m. You means the individual or entity exercising the Licensed Rights
+ under this Public License. Your has a corresponding meaning.
+
+
+Section 2 -- Scope.
+
+ a. License grant.
+
+ 1. Subject to the terms and conditions of this Public License,
+ the Licensor hereby grants You a worldwide, royalty-free,
+ non-sublicensable, non-exclusive, irrevocable license to
+ exercise the Licensed Rights in the Licensed Material to:
+
+ a. reproduce and Share the Licensed Material, in whole or
+ in part; and
+
+ b. produce, reproduce, and Share Adapted Material.
+
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
+ Exceptions and Limitations apply to Your use, this Public
+ License does not apply, and You do not need to comply with
+ its terms and conditions.
+
+ 3. Term. The term of this Public License is specified in Section
+ 6(a).
+
+ 4. Media and formats; technical modifications allowed. The
+ Licensor authorizes You to exercise the Licensed Rights in
+ all media and formats whether now known or hereafter created,
+ and to make technical modifications necessary to do so. The
+ Licensor waives and/or agrees not to assert any right or
+ authority to forbid You from making technical modifications
+ necessary to exercise the Licensed Rights, including
+ technical modifications necessary to circumvent Effective
+ Technological Measures. For purposes of this Public License,
+ simply making modifications authorized by this Section 2(a)
+ (4) never produces Adapted Material.
+
+ 5. Downstream recipients.
+
+ a. Offer from the Licensor -- Licensed Material. Every
+ recipient of the Licensed Material automatically
+ receives an offer from the Licensor to exercise the
+ Licensed Rights under the terms and conditions of this
+ Public License.
+
+ b. Additional offer from the Licensor -- Adapted Material.
+ Every recipient of Adapted Material from You
+ automatically receives an offer from the Licensor to
+ exercise the Licensed Rights in the Adapted Material
+ under the conditions of the Adapter's License You apply.
+
+ c. No downstream restrictions. You may not offer or impose
+ any additional or different terms or conditions on, or
+ apply any Effective Technological Measures to, the
+ Licensed Material if doing so restricts exercise of the
+ Licensed Rights by any recipient of the Licensed
+ Material.
-Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
+ 6. No endorsement. Nothing in this Public License constitutes or
+ may be construed as permission to assert or imply that You
+ are, or that Your use of the Licensed Material is, connected
+ with, or sponsored, endorsed, or granted official status by,
+ the Licensor or others designated to receive attribution as
+ provided in Section 3(a)(1)(A)(i).
-### Using Creative Commons Public Licenses
+ b. Other rights.
-Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
+ 1. Moral rights, such as the right of integrity, are not
+ licensed under this Public License, nor are publicity,
+ privacy, and/or other similar personality rights; however, to
+ the extent possible, the Licensor waives and/or agrees not to
+ assert any such rights held by the Licensor to the limited
+ extent necessary to allow You to exercise the Licensed
+ Rights, but not otherwise.
-* __Considerations for licensors:__ Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. [More considerations for licensors](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors).
+ 2. Patent and trademark rights are not licensed under this
+ Public License.
-* __Considerations for the public:__ By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. [More considerations for the public](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees).
+ 3. To the extent possible, the Licensor waives any right to
+ collect royalties from You for the exercise of the Licensed
+ Rights, whether directly or through a collecting society
+ under any voluntary or waivable statutory or compulsory
+ licensing scheme. In all other cases the Licensor expressly
+ reserves any right to collect such royalties.
-## Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License
-By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
+Section 3 -- License Conditions.
-### Section 1 – Definitions.
+Your exercise of the Licensed Rights is expressly made subject to the
+following conditions.
-a. __Adapted Material__ means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
+ a. Attribution.
-b. __Adapter's License__ means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
+ 1. If You Share the Licensed Material (including in modified
+ form), You must:
-c. __BY-NC-SA Compatible License__ means a license listed at [creativecommons.org/compatiblelicenses](http://creativecommons.org/compatiblelicenses), approved by Creative Commons as essentially the equivalent of this Public License.
+ a. retain the following if it is supplied by the Licensor
+ with the Licensed Material:
-d. __Copyright and Similar Rights__ means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
+ i. identification of the creator(s) of the Licensed
+ Material and any others designated to receive
+ attribution, in any reasonable manner requested by
+ the Licensor (including by pseudonym if
+ designated);
-e. __Effective Technological Measures__ means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
+ ii. a copyright notice;
-f. __Exceptions and Limitations__ means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
+ iii. a notice that refers to this Public License;
+
+ iv. a notice that refers to the disclaimer of
+ warranties;
-g. __License Elements__ means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution, NonCommercial, and ShareAlike.
+ v. a URI or hyperlink to the Licensed Material to the
+ extent reasonably practicable;
-h. __Licensed Material__ means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
+ b. indicate if You modified the Licensed Material and
+ retain an indication of any previous modifications; and
+
+ c. indicate the Licensed Material is licensed under this
+ Public License, and include the text of, or the URI or
+ hyperlink to, this Public License.
-i. __Licensed Rights__ means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
+ reasonable manner based on the medium, means, and context in
+ which You Share the Licensed Material. For example, it may be
+ reasonable to satisfy the conditions by providing a URI or
+ hyperlink to a resource that includes the required
+ information.
+
+ 3. If requested by the Licensor, You must remove any of the
+ information required by Section 3(a)(1)(A) to the extent
+ reasonably practicable.
-j. __Licensor__ means the individual(s) or entity(ies) granting rights under this Public License.
+ b. ShareAlike.
-k. __NonCommercial__ means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
+ In addition to the conditions in Section 3(a), if You Share
+ Adapted Material You produce, the following conditions also apply.
-l. __Share__ means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
+ 1. The Adapter's License You apply must be a Creative Commons
+ license with the same License Elements, this version or
+ later, or a BY-SA Compatible License.
-m. __Sui Generis Database Rights__ means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
+ 2. You must include the text of, or the URI or hyperlink to, the
+ Adapter's License You apply. You may satisfy this condition
+ in any reasonable manner based on the medium, means, and
+ context in which You Share Adapted Material.
-n. __You__ means the individual or entity exercising the Licensed Rights under this Public License. __Your__ has a corresponding meaning.
+ 3. You may not offer or impose any additional or different terms
+ or conditions on, or apply any Effective Technological
+ Measures to, Adapted Material that restrict exercise of the
+ rights granted under the Adapter's License You apply.
-### Section 2 – Scope.
-a. ___License grant.___
+Section 4 -- Sui Generis Database Rights.
- 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
+Where the Licensed Rights include Sui Generis Database Rights that
+apply to Your use of the Licensed Material:
- A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+ to extract, reuse, reproduce, and Share all or a substantial
+ portion of the contents of the database;
- B. produce, reproduce, and Share Adapted Material for NonCommercial purposes only.
+ b. if You include all or a substantial portion of the database
+ contents in a database in which You have Sui Generis Database
+ Rights, then the database in which You have Sui Generis Database
+ Rights (but not its individual contents) is Adapted Material,
- 2. __Exceptions and Limitations.__ For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
+ including for purposes of Section 3(b); and
+ c. You must comply with the conditions in Section 3(a) if You Share
+ all or a substantial portion of the contents of the database.
- 3. __Term.__ The term of this Public License is specified in Section 6(a).
+For the avoidance of doubt, this Section 4 supplements and does not
+replace Your obligations under this Public License where the Licensed
+Rights include other Copyright and Similar Rights.
- 4. __Media and formats; technical modifications allowed.__ The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
- 5. __Downstream recipients.__
+Section 5 -- Disclaimer of Warranties and Limitation of Liability.
- A. __Offer from the Licensor – Licensed Material.__ Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
- B. __Additional offer from the Licensor – Adapted Material.__ Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply.
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
- C. __No downstream restrictions.__ You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
+ c. The disclaimer of warranties and limitation of liability provided
+ above shall be interpreted in a manner that, to the extent
+ possible, most closely approximates an absolute disclaimer and
+ waiver of all liability.
- 6. __No endorsement.__ Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
-b. ___Other rights.___
+Section 6 -- Term and Termination.
- 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
+ a. This Public License applies for the term of the Copyright and
+ Similar Rights licensed here. However, if You fail to comply with
+ this Public License, then Your rights under this Public License
+ terminate automatically.
- 2. Patent and trademark rights are not licensed under this Public License.
+ b. Where Your right to use the Licensed Material has terminated under
+ Section 6(a), it reinstates:
- 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.
+ 1. automatically as of the date the violation is cured, provided
+ it is cured within 30 days of Your discovery of the
+ violation; or
-### Section 3 – License Conditions.
+ 2. upon express reinstatement by the Licensor.
-Your exercise of the Licensed Rights is expressly made subject to the following conditions.
+ For the avoidance of doubt, this Section 6(b) does not affect any
+ right the Licensor may have to seek remedies for Your violations
+ of this Public License.
-a. ___Attribution.___
+ c. For the avoidance of doubt, the Licensor may also offer the
+ Licensed Material under separate terms or conditions or stop
+ distributing the Licensed Material at any time; however, doing so
+ will not terminate this Public License.
- 1. If You Share the Licensed Material (including in modified form), You must:
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+ License.
- A. retain the following if it is supplied by the Licensor with the Licensed Material:
- i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
+Section 7 -- Other Terms and Conditions.
- ii. a copyright notice;
+ a. The Licensor shall not be bound by any additional or different
+ terms or conditions communicated by You unless expressly agreed.
- iii. a notice that refers to this Public License;
+ b. Any arrangements, understandings, or agreements regarding the
+ Licensed Material not stated herein are separate from and
+ independent of the terms and conditions of this Public License.
- iv. a notice that refers to the disclaimer of warranties;
- v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
+Section 8 -- Interpretation.
- B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
+ a. For the avoidance of doubt, this Public License does not, and
+ shall not be interpreted to, reduce, limit, restrict, or impose
+ conditions on any use of the Licensed Material that could lawfully
+ be made without permission under this Public License.
- C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
+ b. To the extent possible, if any provision of this Public License is
+ deemed unenforceable, it shall be automatically reformed to the
+ minimum extent necessary to make it enforceable. If the provision
+ cannot be reformed, it shall be severed from this Public License
+ without affecting the enforceability of the remaining terms and
+ conditions.
- 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
+ c. No term or condition of this Public License will be waived and no
+ failure to comply consented to unless expressly agreed to by the
+ Licensor.
- 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
+ d. Nothing in this Public License constitutes or may be interpreted
+ as a limitation upon, or waiver of, any privileges and immunities
+ that apply to the Licensor or You, including from the legal
+ processes of any jurisdiction or authority.
-b. ___ShareAlike.___
-In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
+=======================================================================
+
+Creative Commons is not a party to its public
+licenses. Notwithstanding, Creative Commons may elect to apply one of
+its public licenses to material it publishes and in those instances
+will be considered the “Licensor.” The text of the Creative Commons
+public licenses is dedicated to the public domain under the CC0 Public
+Domain Dedication. Except for the limited purpose of indicating that
+material is shared under a Creative Commons public license or as
+otherwise permitted by the Creative Commons policies published at
+creativecommons.org/policies, Creative Commons does not authorize the
+use of the trademark "Creative Commons" or any other trademark or logo
+of Creative Commons without its prior written consent including,
+without limitation, in connection with any unauthorized modifications
+to any of its public licenses or any other arrangements,
+understandings, or agreements concerning use of licensed material. For
+the avoidance of doubt, this paragraph does not form part of the
+public licenses.
-1. The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-NC-SA Compatible License.
-
-2. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
-
-3. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
-
-### Section 4 – Sui Generis Database Rights.
-
-Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
-
-a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only;
-
-b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and
-
-c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
-
-For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
-
-### Section 5 – Disclaimer of Warranties and Limitation of Liability.
-
-a. __Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.__
-
-b. __To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.__
-
-c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
-
-### Section 6 – Term and Termination.
-
-a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
-
-b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
-
- 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
-
- 2. upon express reinstatement by the Licensor.
-
- For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
-
-c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
-
-d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
-
-### Section 7 – Other Terms and Conditions.
-
-a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
-
-b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
-
-### Section 8 – Interpretation.
-
-a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
-
-b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
-
-c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
-
-d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
-
-> Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at [creativecommons.org/policies](http://creativecommons.org/policies), Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
->
-> Creative Commons may be contacted at creativecommons.org
+Creative Commons may be contacted at creativecommons.org.
diff --git a/README.md b/README.md
index 395d94c..c399657 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,9 @@
-# :book: 图解算法数据结构
-
-[](https://github.com/krahets/LeetCode-Book) [](https://github.com/krahets/LeetCode-Book) [](https://github.com/krahets)
+# :book: 图解算法数据结构
 [](https://github.com/krahets/LeetCode-Book/tree/main/python) [](https://github.com/krahets/LeetCode-Book/tree/main/java) [](https://github.com/krahets/LeetCode-Book/tree/main/cpp)
+[](https://github.com/krahets/LeetCode-Book) [](https://github.com/krahets/LeetCode-Book)
+
[
](https://leetcode-cn.com/leetbook/detail/illustration-of-algorithm/)
LeetBook《图解算法数据结构》面向算法初学者、互联网求职者设计,主要内容包括:
@@ -183,4 +183,6 @@ LeetBook《图解算法数据结构》面向算法初学者、互联网求职者
若本书对您有所帮助,麻烦请您点个 Star :star: 啦,谢谢!
-
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
+## License
+
+This work is licensed under CC-BY-SA-4.0 license.
From ba00e1fc80220d07d3a300193fe7658a81f69423 Mon Sep 17 00:00:00 2001
From: Yudong Jin
Date: Mon, 28 Nov 2022 03:54:10 +0800
Subject: [PATCH 02/23] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index c399657..4b44dd7 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ LeetBook《图解算法数据结构》面向算法初学者、互联网求职者
- **基础知识:** 时间复杂度、空间复杂度等算法知识。
- **数据结构:** 数组、栈、队列、字符串、链表、树、图、堆、哈希表。
-- **算法专题:** 分治算法、动态规划、搜索与回溯算法、查找算法、贪心算法、排序、位运算、双指针、模拟、数学。
+- **算法专题:** 分治算法、动态规划、搜索与回溯、查找算法、贪心算法、排序、位运算、双指针、模拟、数学。
## :student: 适合人群
From b1015406fc10c1a3bc74e23851ea9237632c06d7 Mon Sep 17 00:00:00 2001
From: Yudong Jin
Date: Sat, 3 Dec 2022 02:34:38 +0800
Subject: [PATCH 03/23] Update README.md
---
README.md | 69 ++++++++++++++++++++++++++-----------------------------
1 file changed, 32 insertions(+), 37 deletions(-)
diff --git a/README.md b/README.md
index 4b44dd7..3602847 100644
--- a/README.md
+++ b/README.md
@@ -12,13 +12,13 @@ LeetBook《图解算法数据结构》面向算法初学者、互联网求职者
- 图文详解 75 道题目,覆盖主要算法知识点,非常适合作为算法学习的 **第一份题库** 。
- 题库活跃于各大互联网公司招聘中,可使笔面试准备事半功倍。
-- 致力于行文深入浅出、图文搭配,提供简洁的 **Python3, Java, C++** 解题代码。
-- 笔者整理了 **30 天刷题计划**、**题目分类**,让刷题有迹可循。
+- 行文深入浅出、图文搭配,提供简洁的 **Python, Java, C++** 解题代码。
+- 提供 **30 天刷题计划**、**题目分类**,让刷题有迹可循。
-### :blue_book: 数据结构与算法专栏
+### :blue_book: 基础知识与算法专题
-- **基础知识:** 时间复杂度、空间复杂度等算法知识。
-- **数据结构:** 数组、栈、队列、字符串、链表、树、图、堆、哈希表。
+- **基础知识:** 时间复杂度、空间复杂度的概念与推算方法。
+- **数据结构:** 数组、栈、队列、字符串、链表、树、图、堆、哈希表的基本用法。
- **算法专题:** 分治算法、动态规划、搜索与回溯、查找算法、贪心算法、排序、位运算、双指针、模拟、数学。
## :student: 适合人群
@@ -29,46 +29,41 @@ LeetBook《图解算法数据结构》面向算法初学者、互联网求职者
---
-## :ledger: 算法专栏
+# 算法学习路线
-### 「[数据结构](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/50e446/)」
+## :book: 第一步:算法快速入门
-> 建议对数据结构不熟悉的同学,先看这篇熟悉用法。
+如果您是算法初学者,建议先读一本算法入门书,可大幅提升 :rocket: 刷题效率。
-- 常用数据结构的**分类**和**基本特点**。
-- 在算法解题中,数据结构的**常用操作**。
-- 在 Python3 , Java , C++ 语言中,各数据结构的**初始化与构建方法**。
+
+
+
+
+
-### 「[算法复杂度](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/r84gmi/)」
+
+
+ 前往阅读 >
+
+ hello-algo.com
+
+
+
-> 复杂度是算法优劣性的有力评价指标,对于理解算法起着至关重要的作用。
+
+
+ 前往仓库 >
+
+ github.com/krahets/hello-algo
+
+
+
-- 什么是时间复杂度、空间复杂度?
-- 时间复杂度和空间复杂度的**概念定义**、**符号表示**、**常见种类**、**时空权衡**。
-- 时间与空间复杂度的**示例题目与解析**。
+## :hourglass: 第二步:按计划刷题
-### 「[动态规划](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/m5zfc1/)」
+本《剑指 Offer》刷题计划已被力扣(LeetCode)官方采用,理念为从易到难、从基础类题目到综合类题目。
-> 动态规划是算法重难点,也是笔面试重要考点,需要重点理解与练习。
-
-- 动态规划问题特点,动态规划和分治算法的联系与区别;
-- 借助例题介绍**重叠子问题**和**最优子结构**分别是什么,以及动态规划是如何解决它们的;
-- 动态规划的**解题框架**总结;
-- 动态规划的**练习例题**,从易到难排序;
-
-### 「[排序算法](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/pxal47/)」
-
-> 排序是最经典的算法问题之一,由浅入深的多种算法涵盖多个算法知识点(例如暴力搜索、分治算法、堆数据结构等)。
-
-- 排序算法分类方法,包括稳定性 、就地性 、自适应性;
-- 排序算法与二分查找、双指针算法之间的关系;
-- 各主要排序算法的时间复杂度与空间复杂度;
-
----
-
-## :hourglass: 刷题计划
-
-笔者整理了《剑指 Offer 》刷题计划,核心理念为从易到难、从基础类题目到综合类题目,供希望按照知识点类型顺序刷题的小伙伴们参考。行百里者半九十,坚持一个月刷完,一起加油!
+行百里者半九十,坚持一个月刷完,一起加油!
| 日程 | 题目 |
| :--------: | :------------------------------------------------ |
From 027869401f56c91c2938da051b2b6e2edf19ea5d Mon Sep 17 00:00:00 2001
From: krahets
Date: Wed, 15 Feb 2023 04:15:10 +0800
Subject: [PATCH 04/23] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
mode change 100644 => 100755 README.md
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
index 3602847..a040211
--- a/README.md
+++ b/README.md
@@ -61,7 +61,7 @@ LeetBook《图解算法数据结构》面向算法初学者、互联网求职者
## :hourglass: 第二步:按计划刷题
-本《剑指 Offer》刷题计划已被力扣(LeetCode)官方采用,理念为从易到难、从基础类题目到综合类题目。
+本《剑指 Offer》刷题计划已被[力扣(LeetCode)官方题单](https://leetcode.cn/study-plan/lcof/)采用,理念为从易到难、从基础类题目到综合类题目。
行百里者半九十,坚持一个月刷完,一起加油!
From f79c85e6047c25656953aaaefd5e5cfd69cda51e Mon Sep 17 00:00:00 2001
From: Yudong Jin
Date: Wed, 14 Jun 2023 18:00:16 +0800
Subject: [PATCH 05/23] Update README.md
---
README.md | 39 ++++++++-------------------------------
1 file changed, 8 insertions(+), 31 deletions(-)
diff --git a/README.md b/README.md
index a040211..2754ca9 100755
--- a/README.md
+++ b/README.md
@@ -1,46 +1,25 @@
-# :book: 图解算法数据结构
+[
](https://leetcode-cn.com/leetbook/detail/illustration-of-algorithm/)
 [](https://github.com/krahets/LeetCode-Book/tree/main/python) [](https://github.com/krahets/LeetCode-Book/tree/main/java) [](https://github.com/krahets/LeetCode-Book/tree/main/cpp)
-[](https://github.com/krahets/LeetCode-Book) [](https://github.com/krahets/LeetCode-Book)
+[LeetBook《图解算法数据结构》](https://leetcode-cn.com/leetbook/detail/illustration-of-algorithm/)是一本面向算法初学者、互联网求职者编写的算法题目解析手册。
-[
](https://leetcode-cn.com/leetbook/detail/illustration-of-algorithm/)
-
-LeetBook《图解算法数据结构》面向算法初学者、互联网求职者设计,主要内容包括:
-
-### :green_book: 剑指 Offer 图文题解
-
-- 图文详解 75 道题目,覆盖主要算法知识点,非常适合作为算法学习的 **第一份题库** 。
-- 题库活跃于各大互联网公司招聘中,可使笔面试准备事半功倍。
+- 图文详解《剑指 Offer》的所有题目,题库活跃于各大互联网公司笔面试。
- 行文深入浅出、图文搭配,提供简洁的 **Python, Java, C++** 解题代码。
- 提供 **30 天刷题计划**、**题目分类**,让刷题有迹可循。
-### :blue_book: 基础知识与算法专题
-
-- **基础知识:** 时间复杂度、空间复杂度的概念与推算方法。
-- **数据结构:** 数组、栈、队列、字符串、链表、树、图、堆、哈希表的基本用法。
-- **算法专题:** 分治算法、动态规划、搜索与回溯、查找算法、贪心算法、排序、位运算、双指针、模拟、数学。
-
-## :student: 适合人群
-
-- 互联网算法、软件岗位求职者。
-- 从零开始接触数据结构与算法的同学。
-- 具有一定编程基础,计划系统学习算法的同学。
+> 若本 LeetBook 对您有所帮助,请在页面右上角点个 Star :star: 支持一下,谢谢!
---
-# 算法学习路线
-
-## :book: 第一步:算法快速入门
-
-如果您是算法初学者,建议先读一本算法入门书,可大幅提升 :rocket: 刷题效率。
-
+如果您是算法初学者,推荐阅读《Hello 算法》,夯实基础,可大幅提升刷题效率。
+
前往阅读 >
@@ -59,9 +38,9 @@ LeetBook《图解算法数据结构》面向算法初学者、互联网求职者
-## :hourglass: 第二步:按计划刷题
+---
-本《剑指 Offer》刷题计划已被[力扣(LeetCode)官方题单](https://leetcode.cn/study-plan/lcof/)采用,理念为从易到难、从基础类题目到综合类题目。
+本《剑指 Offer》刷题计划已被[力扣(LeetCode)官方题单](https://leetcode.cn/study-plan/lcof/)采用。
行百里者半九十,坚持一个月刷完,一起加油!
@@ -176,8 +155,6 @@ LeetBook《图解算法数据结构》面向算法初学者、互联网求职者
---
-若本书对您有所帮助,麻烦请您点个 Star :star: 啦,谢谢!
-
## License
This work is licensed under CC-BY-SA-4.0 license.
From d3f7e15edbc254428d7318a2bac89b60c0a4a55e Mon Sep 17 00:00:00 2001
From: Yudong Jin
Date: Mon, 19 Jun 2023 17:06:54 +0800
Subject: [PATCH 06/23] Update README.md
---
README.md | 54 ++++++++++++++++++++++++++++--------------------------
1 file changed, 28 insertions(+), 26 deletions(-)
diff --git a/README.md b/README.md
index 2754ca9..2e27e4b 100755
--- a/README.md
+++ b/README.md
@@ -1,42 +1,44 @@
-[
](https://leetcode-cn.com/leetbook/detail/illustration-of-algorithm/)
+
+
+
+
+
- [](https://github.com/krahets/LeetCode-Book/tree/main/python) [](https://github.com/krahets/LeetCode-Book/tree/main/java) [](https://github.com/krahets/LeetCode-Book/tree/main/cpp)
+
+
+
+
+
+
-[LeetBook《图解算法数据结构》](https://leetcode-cn.com/leetbook/detail/illustration-of-algorithm/)是一本面向算法初学者、互联网求职者编写的算法题目解析手册。
+[《图解算法数据结构》](https://leetcode-cn.com/leetbook/detail/illustration-of-algorithm/)是一本面向算法初学者和互联网求职者编写的 LeetBook 手册。
-- 图文详解《剑指 Offer》的所有题目,题库活跃于各大互联网公司笔面试。
-- 行文深入浅出、图文搭配,提供简洁的 **Python, Java, C++** 解题代码。
-- 提供 **30 天刷题计划**、**题目分类**,让刷题有迹可循。
+- 图文并茂地讲解《剑指 Offer》75 道题目,题库活跃于各大互联网公司笔面试。
+- 重点解析部分算法知识,包括复杂度分析、数据结构、排序算法和动态规划等。
+- 提供简洁的 Python, Java, C++ 解题代码和一个月刷题计划,让刷题有迹可循。
> 若本 LeetBook 对您有所帮助,请在页面右上角点个 Star :star: 支持一下,谢谢!
---
-
-
-
-
+
+
+
-如果您是算法初学者,推荐阅读《Hello 算法》,夯实基础,可大幅提升刷题效率。
-
-
-
- 前往阅读 >
-
- hello-algo.com
-
-
+
+ 推荐算法初学者阅读《Hello 算法》,夯实基础后可大幅提升刷题效率
-
-
+
+
前往仓库 >
-
- github.com/krahets/hello-algo
-
-
-
+
+
+
+ 在线阅读 >
+
+
---
From cec2ddfbb965964ea430b5f7ac784bfc3bdeba15 Mon Sep 17 00:00:00 2001
From: Yudong Jin
Date: Sat, 22 Jul 2023 04:34:52 +0800
Subject: [PATCH 07/23] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 2e27e4b..8b48835 100755
--- a/README.md
+++ b/README.md
@@ -22,8 +22,8 @@
---
-
-
+
+
From 3b24a1eb93d44d4699e9ec5f755689f698bb076e Mon Sep 17 00:00:00 2001
From: krahets
Date: Tue, 10 Oct 2023 19:48:36 +0800
Subject: [PATCH 08/23] Move the code to sword_for_offer directory.
---
{cpp => sword_for_offer/codes/cpp}/include/ListNode.hpp | 0
{cpp => sword_for_offer/codes/cpp}/include/PrintUtil.hpp | 0
{cpp => sword_for_offer/codes/cpp}/include/TreeNode.hpp | 0
{cpp => sword_for_offer/codes/cpp}/include/include.hpp | 0
.../sfo_03_find_duplicate_numbers_in_an_array_s1.cpp | 0
.../sfo_03_find_duplicate_numbers_in_an_array_s2.cpp | 0
.../sfo_04_find_a_number_in_2d_matrix_s1.cpp | 0
.../cpp}/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.cpp | 0
.../sfo_06_print_a_linked_list_in_reverse_order_s1.cpp | 0
.../sfo_06_print_a_linked_list_in_reverse_order_s2.cpp | 0
.../sfo_07_reconstruct_binary_tree_s1.cpp | 0
.../sfo_09_implement_a_queue_using_two_stacks_s1.cpp | 0
.../sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.cpp | 0
.../codes/cpp}/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.cpp | 0
.../sfo_11_find_minimum_in_rotated_sorted_array_s1.cpp | 0
.../sfo_11_find_minimum_in_rotated_sorted_array_s2.cpp | 0
.../codes/cpp}/sfo_12_word_search_s1/sfo_12_word_search_s1.cpp | 0
.../sfo_13_range_of_motion_of_a_robot_s1.cpp | 0
.../sfo_13_range_of_motion_of_a_robot_s2.cpp | 0
.../cpp}/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.cpp | 0
.../sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.cpp | 0
.../sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.cpp | 0
.../sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.cpp | 0
.../sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.cpp | 0
.../sfo_18_delete_a_node_from_a_linked_list_s1.cpp | 0
.../sfo_19_regular_expression_matching_s1.cpp | 0
.../sfo_19_regular_expression_matching_s2.cpp | 0
.../sfo_21_adjust_the_order_of_numbers_in_an_array_s1.cpp | 0
.../sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.cpp | 0
.../sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.cpp | 0
.../sfo_24_reverse_a_linked_list_s1.cpp | 0
.../sfo_24_reverse_a_linked_list_s2.cpp | 0
.../sfo_25_combine_two_sorted_linked_lists_s1.cpp | 0
.../sfo_26_substructure_of_a_binary_tree_s1.cpp | 0
.../sfo_27_mirror_of_a_binary_tree_s1.cpp | 0
.../sfo_27_mirror_of_a_binary_tree_s2.cpp | 0
.../sfo_28_symmetric_binary_tree_s1.cpp | 0
.../sfo_29_print_a_given_matrix_in_spiral_form_s1.cpp | 0
.../codes/cpp}/sfo_30_min_stack_s1/sfo_30_min_stack_s1.cpp | 0
.../sfo_31_validate_stack_sequences_s1.cpp | 0
.../sfo_32i_print_a_binary_tree_topbottom_i_s1.cpp | 0
.../sfo_32ii_print_a_binary_tree_topbottom_ii_s1.cpp | 0
.../sfo_32iii_print_a_binary_tree_topbottom_iii_s1.cpp | 0
.../sfo_32iii_print_a_binary_tree_topbottom_iii_s2.cpp | 0
.../sfo_33_postorder_traversal_of_a_binary_search_tree_s1.cpp | 0
.../sfo_33_postorder_traversal_of_a_binary_search_tree_s2.cpp | 0
.../sfo_34_all_xsum_paths_in_a_binary_tree_s1.cpp | 0
...sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.cpp | 0
...sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.cpp | 0
.../sfo_36_binary_search_tree_and_doubly_linked_list_s1.cpp | 0
.../sfo_37_serialize_and_deserialize_a_binary_tree_s1.cpp | 0
.../sfo_38_all_permutations_of_a_string_s1.cpp | 0
.../sfo_39_the_majority_element_in_an_array_s1.cpp | 0
.../sfo_39_the_majority_element_in_an_array_s2.cpp | 0
.../sfo_40_the_smallest_k_numbers_s1.cpp | 0
.../sfo_40_the_smallest_k_numbers_s2.cpp | 0
.../sfo_41_find_median_from_data_stream_s1.cpp | 0
.../sfo_42_largest_sum_contiguous_subarray_s1.cpp | 0
.../sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.cpp | 0
.../codes/cpp}/sfo_44_nth_digit_s1/sfo_44_nth_digit_s1.cpp | 0
.../sfo_45_arrange_an_array_into_the_smallest_number_s1.cpp | 0
.../sfo_45_arrange_an_array_into_the_smallest_number_s2.cpp | 0
.../sfo_46_translate_numbers_into_strings_s1.cpp | 0
.../sfo_46_translate_numbers_into_strings_s2.cpp | 0
.../sfo_46_translate_numbers_into_strings_s3.cpp | 0
.../sfo_47_the_maximum_value_of_gifts_s1.cpp | 0
.../sfo_47_the_maximum_value_of_gifts_s2.cpp | 0
...fo_48_the_longest_substring_without_repeated_characters_s1.cpp | 0
...fo_48_the_longest_substring_without_repeated_characters_s2.cpp | 0
...fo_48_the_longest_substring_without_repeated_characters_s3.cpp | 0
.../codes/cpp}/sfo_49_ugly_numbers_s1/sfo_49_ugly_numbers_s1.cpp | 0
...fo_50_find_the_first_nonrepeating_character_in_a_string_s1.cpp | 0
...fo_50_find_the_first_nonrepeating_character_in_a_string_s2.cpp | 0
.../sfo_51_reversed_pairs_in_an_array_s1.cpp | 0
.../sfo_52_the_first_common_node_in_two_linked_lists_s1.cpp | 0
.../sfo_53i_find_a_number_in_a_sorted_array_s1.cpp | 0
.../sfo_53i_find_a_number_in_a_sorted_array_s2.cpp | 0
.../sfo_53ii_the_missing_number_from_0_to_n1_s1.cpp | 0
.../sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.cpp | 0
.../sfo_55i_depth_of_a_binary_tree_s1.cpp | 0
.../sfo_55i_depth_of_a_binary_tree_s2.cpp | 0
.../sfo_55ii_balanced_binary_tree_s1.cpp | 0
.../sfo_55ii_balanced_binary_tree_s2.cpp | 0
.../sfo_56i_single_number_i_s1/sfo_56i_single_number_i_s1.cpp | 0
.../sfo_56ii_single_number_ii_s1/sfo_56ii_single_number_ii_s1.cpp | 0
.../sfo_56ii_single_number_ii_s2/sfo_56ii_single_number_ii_s2.cpp | 0
.../sfo_57_two_numbers_with_sum_s_s1.cpp | 0
.../sfo_57ii_consecutive_numbers_with_sum_s_s1.cpp | 0
.../sfo_57ii_consecutive_numbers_with_sum_s_s2.cpp | 0
.../sfo_58ii_left_rotation_of_a_string_s1.cpp | 0
.../sfo_58ii_left_rotation_of_a_string_s2.cpp | 0
.../sfo_58ii_left_rotation_of_a_string_s3.cpp | 0
.../codes/cpp}/sfo_59ii_max_queue_s1/sfo_59ii_max_queue_s1.cpp | 0
.../sfo_60_probabilities_for_rolling_n_dices_s1.cpp | 0
.../sfo_61_straight_in_poker_s1/sfo_61_straight_in_poker_s1.cpp | 0
.../sfo_61_straight_in_poker_s2/sfo_61_straight_in_poker_s2.cpp | 0
.../sfo_62_josephus_problem_s1/sfo_62_josephus_problem_s1.cpp | 0
.../sfo_63_the_maximum_profit_of_stocks_s1.cpp | 0
.../cpp}/sfo_64_solve_1_2___n_s1/sfo_64_solve_1_2___n_s1.cpp | 0
...plement_addition_operation_without_arithmetic_operators_s1.cpp | 0
.../sfo_66_a_product_array_puzzle_s1.cpp | 0
.../sfo_67_convert_string_to_int_s1.cpp | 0
...68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.cpp | 0
...68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.cpp | 0
...68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.cpp | 0
.../sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.cpp | 0
.../sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.cpp | 0
{java => sword_for_offer/codes/java}/include/ListNode.java | 0
{java => sword_for_offer/codes/java}/include/PrintUtil.java | 0
{java => sword_for_offer/codes/java}/include/TreeNode.java | 0
.../sfo_03_find_duplicate_numbers_in_an_array_s1.java | 0
.../sfo_03_find_duplicate_numbers_in_an_array_s2.java | 0
.../sfo_04_find_a_number_in_2d_matrix_s1.java | 0
.../java}/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.java | 0
.../sfo_06_print_a_linked_list_in_reverse_order_s1.java | 0
.../sfo_06_print_a_linked_list_in_reverse_order_s2.java | 0
.../sfo_07_reconstruct_binary_tree_s1.java | 0
.../sfo_09_implement_a_queue_using_two_stacks_s1.java | 0
.../sfo_10i_fibonacci_numbers_s1.java | 0
.../codes/java}/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.java | 0
.../sfo_11_find_minimum_in_rotated_sorted_array_s1.java | 0
.../sfo_11_find_minimum_in_rotated_sorted_array_s2.java | 0
.../codes/java}/sfo_12_word_search_s1/sfo_12_word_search_s1.java | 0
.../sfo_13_range_of_motion_of_a_robot_s1.java | 0
.../sfo_13_range_of_motion_of_a_robot_s2.java | 0
.../sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.java | 0
.../sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.java | 0
.../sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.java | 0
.../sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.java | 0
.../sfo_16_powers_of_integers_s1.java | 0
.../sfo_17_print_from_1_to_the_largest_n_digits_s1.java | 0
.../sfo_17_print_from_1_to_the_largest_n_digits_s2.java | 0
.../sfo_17_print_from_1_to_the_largest_n_digits_s3.java | 0
.../sfo_17_print_from_1_to_the_largest_n_digits_s4.java | 0
.../sfo_18_delete_a_node_from_a_linked_list_s1.java | 0
.../sfo_19_regular_expression_matching_s1.java | 0
.../sfo_19_regular_expression_matching_s2.java | 0
.../sfo_20_a_string_representing_a_numeric_value_s1.java | 0
.../sfo_21_adjust_the_order_of_numbers_in_an_array_s1.java | 0
.../sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.java | 0
.../sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.java | 0
.../sfo_24_reverse_a_linked_list_s1.java | 0
.../sfo_24_reverse_a_linked_list_s2.java | 0
.../sfo_25_combine_two_sorted_linked_lists_s1.java | 0
.../sfo_26_substructure_of_a_binary_tree_s1.java | 0
.../sfo_27_mirror_of_a_binary_tree_s1.java | 0
.../sfo_27_mirror_of_a_binary_tree_s2.java | 0
.../sfo_28_symmetric_binary_tree_s1.java | 0
.../sfo_29_print_a_given_matrix_in_spiral_form_s1.java | 0
.../codes/java}/sfo_30_min_stack_s1/sfo_30_min_stack_s1.java | 0
.../sfo_31_validate_stack_sequences_s1.java | 0
.../sfo_32i_print_a_binary_tree_topbottom_i_s1.java | 0
.../sfo_32ii_print_a_binary_tree_topbottom_ii_s1.java | 0
.../sfo_32iii_print_a_binary_tree_topbottom_iii_s1.java | 0
.../sfo_32iii_print_a_binary_tree_topbottom_iii_s2.java | 0
.../sfo_32iii_print_a_binary_tree_topbottom_iii_s3.java | 0
.../sfo_33_postorder_traversal_of_a_binary_search_tree_s1.java | 0
.../sfo_33_postorder_traversal_of_a_binary_search_tree_s2.java | 0
.../sfo_34_all_xsum_paths_in_a_binary_tree_s1.java | 0
...fo_35_clone_a_linked_list_with_next_and_random_pointer_s1.java | 0
...fo_35_clone_a_linked_list_with_next_and_random_pointer_s2.java | 0
.../sfo_36_binary_search_tree_and_doubly_linked_list_s1.java | 0
.../sfo_37_serialize_and_deserialize_a_binary_tree_s1.java | 0
.../sfo_38_all_permutations_of_a_string_s1.java | 0
.../sfo_39_the_majority_element_in_an_array_s1.java | 0
.../sfo_39_the_majority_element_in_an_array_s2.java | 0
.../sfo_40_the_smallest_k_numbers_s1.java | 0
.../sfo_40_the_smallest_k_numbers_s2.java | 0
.../sfo_41_find_median_from_data_stream_s1.java | 0
.../sfo_42_largest_sum_contiguous_subarray_s1.java | 0
.../sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.java | 0
.../codes/java}/sfo_44_nth_digit_s1/sfo_44_nth_digit_s1.java | 0
.../sfo_45_arrange_an_array_into_the_smallest_number_s1.java | 0
.../sfo_45_arrange_an_array_into_the_smallest_number_s2.java | 0
.../sfo_46_translate_numbers_into_strings_s1.java | 0
.../sfo_46_translate_numbers_into_strings_s2.java | 0
.../sfo_46_translate_numbers_into_strings_s3.java | 0
.../sfo_47_the_maximum_value_of_gifts_s1.java | 0
.../sfo_47_the_maximum_value_of_gifts_s2.java | 0
...o_48_the_longest_substring_without_repeated_characters_s1.java | 0
...o_48_the_longest_substring_without_repeated_characters_s2.java | 0
...o_48_the_longest_substring_without_repeated_characters_s3.java | 0
.../java}/sfo_49_ugly_numbers_s1/sfo_49_ugly_numbers_s1.java | 0
...o_50_find_the_first_nonrepeating_character_in_a_string_s1.java | 0
...o_50_find_the_first_nonrepeating_character_in_a_string_s2.java | 0
.../sfo_51_reversed_pairs_in_an_array_s1.java | 0
.../sfo_52_the_first_common_node_in_two_linked_lists_s1.java | 0
.../sfo_53i_find_a_number_in_a_sorted_array_s1.java | 0
.../sfo_53i_find_a_number_in_a_sorted_array_s2.java | 0
.../sfo_53ii_the_missing_number_from_0_to_n1_s1.java | 0
.../sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.java | 0
.../sfo_55i_depth_of_a_binary_tree_s1.java | 0
.../sfo_55i_depth_of_a_binary_tree_s2.java | 0
.../sfo_55ii_balanced_binary_tree_s1.java | 0
.../sfo_55ii_balanced_binary_tree_s2.java | 0
.../sfo_56i_single_number_i_s1/sfo_56i_single_number_i_s1.java | 0
.../sfo_56ii_single_number_ii_s1.java | 0
.../sfo_56ii_single_number_ii_s2.java | 0
.../sfo_57_two_numbers_with_sum_s_s1.java | 0
.../sfo_57ii_consecutive_numbers_with_sum_s_s1.java | 0
.../sfo_57ii_consecutive_numbers_with_sum_s_s2.java | 0
.../sfo_58i_reverse_order_of_words_s1.java | 0
.../sfo_58i_reverse_order_of_words_s2.java | 0
.../sfo_58ii_left_rotation_of_a_string_s1.java | 0
.../sfo_58ii_left_rotation_of_a_string_s2.java | 0
.../sfo_58ii_left_rotation_of_a_string_s3.java | 0
.../sfo_58ii_left_rotation_of_a_string_s4.java | 0
.../sfo_58ii_left_rotation_of_a_string_s5.java | 0
.../sfo_59i_sliding_window_maximum_s1.java | 0
.../sfo_59i_sliding_window_maximum_s2.java | 0
.../codes/java}/sfo_59ii_max_queue_s1/sfo_59ii_max_queue_s1.java | 0
.../sfo_60_probabilities_for_rolling_n_dices_s1.java | 0
.../sfo_61_straight_in_poker_s1/sfo_61_straight_in_poker_s1.java | 0
.../sfo_61_straight_in_poker_s2/sfo_61_straight_in_poker_s2.java | 0
.../sfo_62_josephus_problem_s1/sfo_62_josephus_problem_s1.java | 0
.../sfo_63_the_maximum_profit_of_stocks_s1.java | 0
.../java}/sfo_64_solve_1_2___n_s1/sfo_64_solve_1_2___n_s1.java | 0
.../java}/sfo_64_solve_1_2___n_s2/sfo_64_solve_1_2___n_s2.java | 0
...lement_addition_operation_without_arithmetic_operators_s1.java | 0
.../sfo_66_a_product_array_puzzle_s1.java | 0
.../sfo_67_convert_string_to_int_s1.java | 0
.../sfo_67_convert_string_to_int_s2.java | 0
...8i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.java | 0
...8i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.java | 0
...8i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.java | 0
.../sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.java | 0
.../sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.java | 0
{python => sword_for_offer/codes/python}/include/__init__.py | 0
{python => sword_for_offer/codes/python}/include/binary_tree.py | 0
{python => sword_for_offer/codes/python}/include/linked_list.py | 0
{python => sword_for_offer/codes/python}/include/print_util.py | 0
.../codes/python}/sfo_03_find_duplicate_numbers_in_an_array_s1.py | 0
.../codes/python}/sfo_03_find_duplicate_numbers_in_an_array_s2.py | 0
.../codes/python}/sfo_04_find_a_number_in_2d_matrix_s1.py | 0
.../codes/python}/sfo_05_replace_spaces_s1.py | 0
.../python}/sfo_06_print_a_linked_list_in_reverse_order_s1.py | 0
.../python}/sfo_06_print_a_linked_list_in_reverse_order_s2.py | 0
.../codes/python}/sfo_07_reconstruct_binary_tree_s1.py | 0
.../codes/python}/sfo_09_implement_a_queue_using_two_stacks_s1.py | 0
.../codes/python}/sfo_10i_fibonacci_numbers_s1.py | 0
.../codes/python}/sfo_10i_fibonacci_numbers_s2.py | 0
{python => sword_for_offer/codes/python}/sfo_10ii_frog_jump_s1.py | 0
{python => sword_for_offer/codes/python}/sfo_10ii_frog_jump_s2.py | 0
.../python}/sfo_11_find_minimum_in_rotated_sorted_array_s1.py | 0
.../python}/sfo_11_find_minimum_in_rotated_sorted_array_s2.py | 0
{python => sword_for_offer/codes/python}/sfo_12_word_search_s1.py | 0
.../codes/python}/sfo_13_range_of_motion_of_a_robot_s1.py | 0
.../codes/python}/sfo_13_range_of_motion_of_a_robot_s2.py | 0
.../codes/python}/sfo_14i_cut_the_rope_i_s1.py | 0
.../codes/python}/sfo_14ii_cut_the_rope_ii_s1.py | 0
.../codes/python}/sfo_14ii_cut_the_rope_ii_s2.py | 0
.../codes/python}/sfo_15_number_of_1_bits_s1.py | 0
.../codes/python}/sfo_15_number_of_1_bits_s2.py | 0
.../codes/python}/sfo_16_powers_of_integers_s1.py | 0
.../python}/sfo_17_print_from_1_to_the_largest_n_digits_s1.py | 0
.../python}/sfo_17_print_from_1_to_the_largest_n_digits_s2.py | 0
.../python}/sfo_17_print_from_1_to_the_largest_n_digits_s3.py | 0
.../python}/sfo_17_print_from_1_to_the_largest_n_digits_s4.py | 0
.../codes/python}/sfo_18_delete_a_node_from_a_linked_list_s1.py | 0
.../codes/python}/sfo_19_regular_expression_matching_s1.py | 0
.../codes/python}/sfo_19_regular_expression_matching_s2.py | 0
.../python}/sfo_20_a_string_representing_a_numeric_value_s1.py | 0
.../python}/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.py | 0
.../sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.py | 0
.../sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.py | 0
.../codes/python}/sfo_24_reverse_a_linked_list_s1.py | 0
.../codes/python}/sfo_24_reverse_a_linked_list_s2.py | 0
.../codes/python}/sfo_24_reverse_a_linked_list_s3.py | 0
.../codes/python}/sfo_25_combine_two_sorted_linked_lists_s1.py | 0
.../codes/python}/sfo_26_substructure_of_a_binary_tree_s1.py | 0
.../codes/python}/sfo_27_mirror_of_a_binary_tree_s1.py | 0
.../codes/python}/sfo_27_mirror_of_a_binary_tree_s2.py | 0
.../codes/python}/sfo_27_mirror_of_a_binary_tree_s3.py | 0
.../codes/python}/sfo_28_symmetric_binary_tree_s1.py | 0
.../python}/sfo_29_print_a_given_matrix_in_spiral_form_s1.py | 0
{python => sword_for_offer/codes/python}/sfo_30_min_stack_s1.py | 0
.../codes/python}/sfo_31_validate_stack_sequences_s1.py | 0
.../codes/python}/sfo_32i_print_a_binary_tree_topbottom_i_s1.py | 0
.../codes/python}/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.py | 0
.../python}/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.py | 0
.../python}/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.py | 0
.../python}/sfo_32iii_print_a_binary_tree_topbottom_iii_s3.py | 0
.../sfo_33_postorder_traversal_of_a_binary_search_tree_s1.py | 0
.../sfo_33_postorder_traversal_of_a_binary_search_tree_s2.py | 0
.../codes/python}/sfo_34_all_xsum_paths_in_a_binary_tree_s1.py | 0
.../sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.py | 0
.../sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.py | 0
.../sfo_36_binary_search_tree_and_doubly_linked_list_s1.py | 0
.../python}/sfo_37_serialize_and_deserialize_a_binary_tree_s1.py | 0
.../codes/python}/sfo_38_all_permutations_of_a_string_s1.py | 0
.../codes/python}/sfo_39_the_majority_element_in_an_array_s1.py | 0
.../codes/python}/sfo_39_the_majority_element_in_an_array_s2.py | 0
.../codes/python}/sfo_40_the_smallest_k_numbers_s1.py | 0
.../codes/python}/sfo_40_the_smallest_k_numbers_s2.py | 0
.../codes/python}/sfo_41_find_median_from_data_stream_s1.py | 0
.../codes/python}/sfo_41_find_median_from_data_stream_s2.py | 0
.../codes/python}/sfo_42_largest_sum_contiguous_subarray_s1.py | 0
.../sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.py | 0
{python => sword_for_offer/codes/python}/sfo_44_nth_digit_s1.py | 0
.../sfo_45_arrange_an_array_into_the_smallest_number_s1.py | 0
.../sfo_45_arrange_an_array_into_the_smallest_number_s2.py | 0
.../codes/python}/sfo_46_translate_numbers_into_strings_s1.py | 0
.../codes/python}/sfo_46_translate_numbers_into_strings_s2.py | 0
.../codes/python}/sfo_46_translate_numbers_into_strings_s3.py | 0
.../codes/python}/sfo_46_translate_numbers_into_strings_s4.py | 0
.../codes/python}/sfo_46_translate_numbers_into_strings_s5.py | 0
.../codes/python}/sfo_47_the_maximum_value_of_gifts_s1.py | 0
.../codes/python}/sfo_47_the_maximum_value_of_gifts_s2.py | 0
...sfo_48_the_longest_substring_without_repeated_characters_s1.py | 0
...sfo_48_the_longest_substring_without_repeated_characters_s2.py | 0
...sfo_48_the_longest_substring_without_repeated_characters_s3.py | 0
.../codes/python}/sfo_49_ugly_numbers_s1.py | 0
...sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.py | 0
...sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.py | 0
...sfo_50_find_the_first_nonrepeating_character_in_a_string_s3.py | 0
.../codes/python}/sfo_51_reversed_pairs_in_an_array_s1.py | 0
.../sfo_52_the_first_common_node_in_two_linked_lists_s1.py | 0
.../codes/python}/sfo_53i_find_a_number_in_a_sorted_array_s1.py | 0
.../codes/python}/sfo_53i_find_a_number_in_a_sorted_array_s2.py | 0
.../codes/python}/sfo_53ii_the_missing_number_from_0_to_n1_s1.py | 0
.../sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.py | 0
.../codes/python}/sfo_55i_depth_of_a_binary_tree_s1.py | 0
.../codes/python}/sfo_55i_depth_of_a_binary_tree_s2.py | 0
.../codes/python}/sfo_55ii_balanced_binary_tree_s1.py | 0
.../codes/python}/sfo_55ii_balanced_binary_tree_s2.py | 0
.../codes/python}/sfo_56i_single_number_i_s1.py | 0
.../codes/python}/sfo_56ii_single_number_ii_s1.py | 0
.../codes/python}/sfo_56ii_single_number_ii_s2.py | 0
.../codes/python}/sfo_57_two_numbers_with_sum_s_s1.py | 0
.../codes/python}/sfo_57ii_consecutive_numbers_with_sum_s_s1.py | 0
.../codes/python}/sfo_57ii_consecutive_numbers_with_sum_s_s2.py | 0
.../codes/python}/sfo_58i_reverse_order_of_words_s1.py | 0
.../codes/python}/sfo_58i_reverse_order_of_words_s2.py | 0
.../codes/python}/sfo_58i_reverse_order_of_words_s3.py | 0
.../codes/python}/sfo_58ii_left_rotation_of_a_string_s1.py | 0
.../codes/python}/sfo_58ii_left_rotation_of_a_string_s2.py | 0
.../codes/python}/sfo_58ii_left_rotation_of_a_string_s3.py | 0
.../codes/python}/sfo_58ii_left_rotation_of_a_string_s4.py | 0
.../codes/python}/sfo_58ii_left_rotation_of_a_string_s5.py | 0
.../codes/python}/sfo_59i_sliding_window_maximum_s1.py | 0
.../codes/python}/sfo_59i_sliding_window_maximum_s2.py | 0
{python => sword_for_offer/codes/python}/sfo_59ii_max_queue_s1.py | 0
.../codes/python}/sfo_60_probabilities_for_rolling_n_dices_s1.py | 0
.../codes/python}/sfo_61_straight_in_poker_s1.py | 0
.../codes/python}/sfo_61_straight_in_poker_s2.py | 0
.../codes/python}/sfo_62_josephus_problem_s1.py | 0
.../codes/python}/sfo_63_the_maximum_profit_of_stocks_s1.py | 0
.../codes/python}/sfo_64_solve_1_2___n_s1.py | 0
...mplement_addition_operation_without_arithmetic_operators_s1.py | 0
.../codes/python}/sfo_66_a_product_array_puzzle_s1.py | 0
.../codes/python}/sfo_67_convert_string_to_int_s1.py | 0
.../codes/python}/sfo_67_convert_string_to_int_s2.py | 0
..._68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.py | 0
..._68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.py | 0
..._68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.py | 0
.../sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.py | 0
.../sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.py | 0
357 files changed, 0 insertions(+), 0 deletions(-)
rename {cpp => sword_for_offer/codes/cpp}/include/ListNode.hpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/include/PrintUtil.hpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/include/TreeNode.hpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/include/include.hpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_03_find_duplicate_numbers_in_an_array_s1/sfo_03_find_duplicate_numbers_in_an_array_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_12_word_search_s1/sfo_12_word_search_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_30_min_stack_s1/sfo_30_min_stack_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_39_the_majority_element_in_an_array_s1/sfo_39_the_majority_element_in_an_array_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_39_the_majority_element_in_an_array_s2/sfo_39_the_majority_element_in_an_array_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_40_the_smallest_k_numbers_s1/sfo_40_the_smallest_k_numbers_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_40_the_smallest_k_numbers_s2/sfo_40_the_smallest_k_numbers_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_41_find_median_from_data_stream_s1/sfo_41_find_median_from_data_stream_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_42_largest_sum_contiguous_subarray_s1/sfo_42_largest_sum_contiguous_subarray_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_44_nth_digit_s1/sfo_44_nth_digit_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_45_arrange_an_array_into_the_smallest_number_s1/sfo_45_arrange_an_array_into_the_smallest_number_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_45_arrange_an_array_into_the_smallest_number_s2/sfo_45_arrange_an_array_into_the_smallest_number_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_46_translate_numbers_into_strings_s1/sfo_46_translate_numbers_into_strings_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_46_translate_numbers_into_strings_s2/sfo_46_translate_numbers_into_strings_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_46_translate_numbers_into_strings_s3/sfo_46_translate_numbers_into_strings_s3.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_47_the_maximum_value_of_gifts_s1/sfo_47_the_maximum_value_of_gifts_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_47_the_maximum_value_of_gifts_s2/sfo_47_the_maximum_value_of_gifts_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_48_the_longest_substring_without_repeated_characters_s1/sfo_48_the_longest_substring_without_repeated_characters_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_48_the_longest_substring_without_repeated_characters_s2/sfo_48_the_longest_substring_without_repeated_characters_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_48_the_longest_substring_without_repeated_characters_s3/sfo_48_the_longest_substring_without_repeated_characters_s3.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_49_ugly_numbers_s1/sfo_49_ugly_numbers_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_51_reversed_pairs_in_an_array_s1/sfo_51_reversed_pairs_in_an_array_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_52_the_first_common_node_in_two_linked_lists_s1/sfo_52_the_first_common_node_in_two_linked_lists_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_53i_find_a_number_in_a_sorted_array_s1/sfo_53i_find_a_number_in_a_sorted_array_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_53i_find_a_number_in_a_sorted_array_s2/sfo_53i_find_a_number_in_a_sorted_array_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_53ii_the_missing_number_from_0_to_n1_s1/sfo_53ii_the_missing_number_from_0_to_n1_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_55i_depth_of_a_binary_tree_s1/sfo_55i_depth_of_a_binary_tree_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_55i_depth_of_a_binary_tree_s2/sfo_55i_depth_of_a_binary_tree_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_55ii_balanced_binary_tree_s1/sfo_55ii_balanced_binary_tree_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_55ii_balanced_binary_tree_s2/sfo_55ii_balanced_binary_tree_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_56i_single_number_i_s1/sfo_56i_single_number_i_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_56ii_single_number_ii_s1/sfo_56ii_single_number_ii_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_56ii_single_number_ii_s2/sfo_56ii_single_number_ii_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_57_two_numbers_with_sum_s_s1/sfo_57_two_numbers_with_sum_s_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_57ii_consecutive_numbers_with_sum_s_s1/sfo_57ii_consecutive_numbers_with_sum_s_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_57ii_consecutive_numbers_with_sum_s_s2/sfo_57ii_consecutive_numbers_with_sum_s_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_58ii_left_rotation_of_a_string_s1/sfo_58ii_left_rotation_of_a_string_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_58ii_left_rotation_of_a_string_s2/sfo_58ii_left_rotation_of_a_string_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_58ii_left_rotation_of_a_string_s3/sfo_58ii_left_rotation_of_a_string_s3.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_59ii_max_queue_s1/sfo_59ii_max_queue_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_60_probabilities_for_rolling_n_dices_s1/sfo_60_probabilities_for_rolling_n_dices_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_61_straight_in_poker_s1/sfo_61_straight_in_poker_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_61_straight_in_poker_s2/sfo_61_straight_in_poker_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_62_josephus_problem_s1/sfo_62_josephus_problem_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_63_the_maximum_profit_of_stocks_s1/sfo_63_the_maximum_profit_of_stocks_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_64_solve_1_2___n_s1/sfo_64_solve_1_2___n_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_65_implement_addition_operation_without_arithmetic_operators_s1/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_66_a_product_array_puzzle_s1/sfo_66_a_product_array_puzzle_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_67_convert_string_to_int_s1/sfo_67_convert_string_to_int_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.cpp (100%)
rename {cpp => sword_for_offer/codes/cpp}/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.cpp (100%)
rename {java => sword_for_offer/codes/java}/include/ListNode.java (100%)
rename {java => sword_for_offer/codes/java}/include/PrintUtil.java (100%)
rename {java => sword_for_offer/codes/java}/include/TreeNode.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_03_find_duplicate_numbers_in_an_array_s1/sfo_03_find_duplicate_numbers_in_an_array_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_12_word_search_s1/sfo_12_word_search_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_17_print_from_1_to_the_largest_n_digits_s1/sfo_17_print_from_1_to_the_largest_n_digits_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_17_print_from_1_to_the_largest_n_digits_s2/sfo_17_print_from_1_to_the_largest_n_digits_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_17_print_from_1_to_the_largest_n_digits_s3/sfo_17_print_from_1_to_the_largest_n_digits_s3.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_17_print_from_1_to_the_largest_n_digits_s4/sfo_17_print_from_1_to_the_largest_n_digits_s4.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_20_a_string_representing_a_numeric_value_s1/sfo_20_a_string_representing_a_numeric_value_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_30_min_stack_s1/sfo_30_min_stack_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_32iii_print_a_binary_tree_topbottom_iii_s3/sfo_32iii_print_a_binary_tree_topbottom_iii_s3.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_39_the_majority_element_in_an_array_s1/sfo_39_the_majority_element_in_an_array_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_39_the_majority_element_in_an_array_s2/sfo_39_the_majority_element_in_an_array_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_40_the_smallest_k_numbers_s1/sfo_40_the_smallest_k_numbers_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_40_the_smallest_k_numbers_s2/sfo_40_the_smallest_k_numbers_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_41_find_median_from_data_stream_s1/sfo_41_find_median_from_data_stream_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_42_largest_sum_contiguous_subarray_s1/sfo_42_largest_sum_contiguous_subarray_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_44_nth_digit_s1/sfo_44_nth_digit_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_45_arrange_an_array_into_the_smallest_number_s1/sfo_45_arrange_an_array_into_the_smallest_number_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_45_arrange_an_array_into_the_smallest_number_s2/sfo_45_arrange_an_array_into_the_smallest_number_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_46_translate_numbers_into_strings_s1/sfo_46_translate_numbers_into_strings_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_46_translate_numbers_into_strings_s2/sfo_46_translate_numbers_into_strings_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_46_translate_numbers_into_strings_s3/sfo_46_translate_numbers_into_strings_s3.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_47_the_maximum_value_of_gifts_s1/sfo_47_the_maximum_value_of_gifts_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_47_the_maximum_value_of_gifts_s2/sfo_47_the_maximum_value_of_gifts_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_48_the_longest_substring_without_repeated_characters_s1/sfo_48_the_longest_substring_without_repeated_characters_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_48_the_longest_substring_without_repeated_characters_s2/sfo_48_the_longest_substring_without_repeated_characters_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_48_the_longest_substring_without_repeated_characters_s3/sfo_48_the_longest_substring_without_repeated_characters_s3.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_49_ugly_numbers_s1/sfo_49_ugly_numbers_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_51_reversed_pairs_in_an_array_s1/sfo_51_reversed_pairs_in_an_array_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_52_the_first_common_node_in_two_linked_lists_s1/sfo_52_the_first_common_node_in_two_linked_lists_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_53i_find_a_number_in_a_sorted_array_s1/sfo_53i_find_a_number_in_a_sorted_array_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_53i_find_a_number_in_a_sorted_array_s2/sfo_53i_find_a_number_in_a_sorted_array_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_53ii_the_missing_number_from_0_to_n1_s1/sfo_53ii_the_missing_number_from_0_to_n1_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_55i_depth_of_a_binary_tree_s1/sfo_55i_depth_of_a_binary_tree_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_55i_depth_of_a_binary_tree_s2/sfo_55i_depth_of_a_binary_tree_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_55ii_balanced_binary_tree_s1/sfo_55ii_balanced_binary_tree_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_55ii_balanced_binary_tree_s2/sfo_55ii_balanced_binary_tree_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_56i_single_number_i_s1/sfo_56i_single_number_i_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_56ii_single_number_ii_s1/sfo_56ii_single_number_ii_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_56ii_single_number_ii_s2/sfo_56ii_single_number_ii_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_57_two_numbers_with_sum_s_s1/sfo_57_two_numbers_with_sum_s_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_57ii_consecutive_numbers_with_sum_s_s1/sfo_57ii_consecutive_numbers_with_sum_s_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_57ii_consecutive_numbers_with_sum_s_s2/sfo_57ii_consecutive_numbers_with_sum_s_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_58i_reverse_order_of_words_s1/sfo_58i_reverse_order_of_words_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_58i_reverse_order_of_words_s2/sfo_58i_reverse_order_of_words_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_58ii_left_rotation_of_a_string_s1/sfo_58ii_left_rotation_of_a_string_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_58ii_left_rotation_of_a_string_s2/sfo_58ii_left_rotation_of_a_string_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_58ii_left_rotation_of_a_string_s3/sfo_58ii_left_rotation_of_a_string_s3.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_58ii_left_rotation_of_a_string_s4/sfo_58ii_left_rotation_of_a_string_s4.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_58ii_left_rotation_of_a_string_s5/sfo_58ii_left_rotation_of_a_string_s5.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_59i_sliding_window_maximum_s1/sfo_59i_sliding_window_maximum_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_59i_sliding_window_maximum_s2/sfo_59i_sliding_window_maximum_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_59ii_max_queue_s1/sfo_59ii_max_queue_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_60_probabilities_for_rolling_n_dices_s1/sfo_60_probabilities_for_rolling_n_dices_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_61_straight_in_poker_s1/sfo_61_straight_in_poker_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_61_straight_in_poker_s2/sfo_61_straight_in_poker_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_62_josephus_problem_s1/sfo_62_josephus_problem_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_63_the_maximum_profit_of_stocks_s1/sfo_63_the_maximum_profit_of_stocks_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_64_solve_1_2___n_s1/sfo_64_solve_1_2___n_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_64_solve_1_2___n_s2/sfo_64_solve_1_2___n_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_65_implement_addition_operation_without_arithmetic_operators_s1/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_66_a_product_array_puzzle_s1/sfo_66_a_product_array_puzzle_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_67_convert_string_to_int_s1/sfo_67_convert_string_to_int_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_67_convert_string_to_int_s2/sfo_67_convert_string_to_int_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.java (100%)
rename {java => sword_for_offer/codes/java}/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.java (100%)
rename {python => sword_for_offer/codes/python}/include/__init__.py (100%)
rename {python => sword_for_offer/codes/python}/include/binary_tree.py (100%)
rename {python => sword_for_offer/codes/python}/include/linked_list.py (100%)
rename {python => sword_for_offer/codes/python}/include/print_util.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_03_find_duplicate_numbers_in_an_array_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_03_find_duplicate_numbers_in_an_array_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_04_find_a_number_in_2d_matrix_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_05_replace_spaces_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_06_print_a_linked_list_in_reverse_order_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_06_print_a_linked_list_in_reverse_order_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_07_reconstruct_binary_tree_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_09_implement_a_queue_using_two_stacks_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_10i_fibonacci_numbers_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_10i_fibonacci_numbers_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_10ii_frog_jump_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_10ii_frog_jump_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_11_find_minimum_in_rotated_sorted_array_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_11_find_minimum_in_rotated_sorted_array_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_12_word_search_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_13_range_of_motion_of_a_robot_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_13_range_of_motion_of_a_robot_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_14i_cut_the_rope_i_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_14ii_cut_the_rope_ii_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_14ii_cut_the_rope_ii_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_15_number_of_1_bits_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_15_number_of_1_bits_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_16_powers_of_integers_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_17_print_from_1_to_the_largest_n_digits_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_17_print_from_1_to_the_largest_n_digits_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_17_print_from_1_to_the_largest_n_digits_s3.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_17_print_from_1_to_the_largest_n_digits_s4.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_18_delete_a_node_from_a_linked_list_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_19_regular_expression_matching_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_19_regular_expression_matching_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_20_a_string_representing_a_numeric_value_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_24_reverse_a_linked_list_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_24_reverse_a_linked_list_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_24_reverse_a_linked_list_s3.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_25_combine_two_sorted_linked_lists_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_26_substructure_of_a_binary_tree_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_27_mirror_of_a_binary_tree_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_27_mirror_of_a_binary_tree_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_27_mirror_of_a_binary_tree_s3.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_28_symmetric_binary_tree_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_29_print_a_given_matrix_in_spiral_form_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_30_min_stack_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_31_validate_stack_sequences_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_32i_print_a_binary_tree_topbottom_i_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_32iii_print_a_binary_tree_topbottom_iii_s3.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_34_all_xsum_paths_in_a_binary_tree_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_36_binary_search_tree_and_doubly_linked_list_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_37_serialize_and_deserialize_a_binary_tree_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_38_all_permutations_of_a_string_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_39_the_majority_element_in_an_array_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_39_the_majority_element_in_an_array_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_40_the_smallest_k_numbers_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_40_the_smallest_k_numbers_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_41_find_median_from_data_stream_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_41_find_median_from_data_stream_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_42_largest_sum_contiguous_subarray_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_44_nth_digit_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_45_arrange_an_array_into_the_smallest_number_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_45_arrange_an_array_into_the_smallest_number_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_46_translate_numbers_into_strings_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_46_translate_numbers_into_strings_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_46_translate_numbers_into_strings_s3.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_46_translate_numbers_into_strings_s4.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_46_translate_numbers_into_strings_s5.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_47_the_maximum_value_of_gifts_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_47_the_maximum_value_of_gifts_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_48_the_longest_substring_without_repeated_characters_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_48_the_longest_substring_without_repeated_characters_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_48_the_longest_substring_without_repeated_characters_s3.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_49_ugly_numbers_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_50_find_the_first_nonrepeating_character_in_a_string_s3.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_51_reversed_pairs_in_an_array_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_52_the_first_common_node_in_two_linked_lists_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_53i_find_a_number_in_a_sorted_array_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_53i_find_a_number_in_a_sorted_array_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_53ii_the_missing_number_from_0_to_n1_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_55i_depth_of_a_binary_tree_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_55i_depth_of_a_binary_tree_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_55ii_balanced_binary_tree_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_55ii_balanced_binary_tree_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_56i_single_number_i_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_56ii_single_number_ii_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_56ii_single_number_ii_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_57_two_numbers_with_sum_s_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_57ii_consecutive_numbers_with_sum_s_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_57ii_consecutive_numbers_with_sum_s_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_58i_reverse_order_of_words_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_58i_reverse_order_of_words_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_58i_reverse_order_of_words_s3.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_58ii_left_rotation_of_a_string_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_58ii_left_rotation_of_a_string_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_58ii_left_rotation_of_a_string_s3.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_58ii_left_rotation_of_a_string_s4.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_58ii_left_rotation_of_a_string_s5.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_59i_sliding_window_maximum_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_59i_sliding_window_maximum_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_59ii_max_queue_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_60_probabilities_for_rolling_n_dices_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_61_straight_in_poker_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_61_straight_in_poker_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_62_josephus_problem_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_63_the_maximum_profit_of_stocks_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_64_solve_1_2___n_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_66_a_product_array_puzzle_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_67_convert_string_to_int_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_67_convert_string_to_int_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.py (100%)
rename {python => sword_for_offer/codes/python}/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.py (100%)
diff --git a/cpp/include/ListNode.hpp b/sword_for_offer/codes/cpp/include/ListNode.hpp
similarity index 100%
rename from cpp/include/ListNode.hpp
rename to sword_for_offer/codes/cpp/include/ListNode.hpp
diff --git a/cpp/include/PrintUtil.hpp b/sword_for_offer/codes/cpp/include/PrintUtil.hpp
similarity index 100%
rename from cpp/include/PrintUtil.hpp
rename to sword_for_offer/codes/cpp/include/PrintUtil.hpp
diff --git a/cpp/include/TreeNode.hpp b/sword_for_offer/codes/cpp/include/TreeNode.hpp
similarity index 100%
rename from cpp/include/TreeNode.hpp
rename to sword_for_offer/codes/cpp/include/TreeNode.hpp
diff --git a/cpp/include/include.hpp b/sword_for_offer/codes/cpp/include/include.hpp
similarity index 100%
rename from cpp/include/include.hpp
rename to sword_for_offer/codes/cpp/include/include.hpp
diff --git a/cpp/sfo_03_find_duplicate_numbers_in_an_array_s1/sfo_03_find_duplicate_numbers_in_an_array_s1.cpp b/sword_for_offer/codes/cpp/sfo_03_find_duplicate_numbers_in_an_array_s1/sfo_03_find_duplicate_numbers_in_an_array_s1.cpp
similarity index 100%
rename from cpp/sfo_03_find_duplicate_numbers_in_an_array_s1/sfo_03_find_duplicate_numbers_in_an_array_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_03_find_duplicate_numbers_in_an_array_s1/sfo_03_find_duplicate_numbers_in_an_array_s1.cpp
diff --git a/cpp/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.cpp b/sword_for_offer/codes/cpp/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.cpp
similarity index 100%
rename from cpp/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.cpp
diff --git a/cpp/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.cpp b/sword_for_offer/codes/cpp/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.cpp
similarity index 100%
rename from cpp/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.cpp
diff --git a/cpp/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.cpp b/sword_for_offer/codes/cpp/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.cpp
similarity index 100%
rename from cpp/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.cpp
diff --git a/cpp/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.cpp b/sword_for_offer/codes/cpp/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.cpp
similarity index 100%
rename from cpp/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.cpp
diff --git a/cpp/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.cpp b/sword_for_offer/codes/cpp/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.cpp
similarity index 100%
rename from cpp/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.cpp
diff --git a/cpp/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.cpp
similarity index 100%
rename from cpp/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.cpp
diff --git a/cpp/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.cpp b/sword_for_offer/codes/cpp/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.cpp
similarity index 100%
rename from cpp/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.cpp
diff --git a/cpp/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.cpp b/sword_for_offer/codes/cpp/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.cpp
similarity index 100%
rename from cpp/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.cpp
diff --git a/cpp/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.cpp b/sword_for_offer/codes/cpp/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.cpp
similarity index 100%
rename from cpp/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.cpp
diff --git a/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.cpp b/sword_for_offer/codes/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.cpp
similarity index 100%
rename from cpp/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.cpp
diff --git a/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.cpp b/sword_for_offer/codes/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.cpp
similarity index 100%
rename from cpp/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.cpp
diff --git a/cpp/sfo_12_word_search_s1/sfo_12_word_search_s1.cpp b/sword_for_offer/codes/cpp/sfo_12_word_search_s1/sfo_12_word_search_s1.cpp
similarity index 100%
rename from cpp/sfo_12_word_search_s1/sfo_12_word_search_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_12_word_search_s1/sfo_12_word_search_s1.cpp
diff --git a/cpp/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.cpp b/sword_for_offer/codes/cpp/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.cpp
similarity index 100%
rename from cpp/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.cpp
diff --git a/cpp/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.cpp b/sword_for_offer/codes/cpp/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.cpp
similarity index 100%
rename from cpp/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.cpp
diff --git a/cpp/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.cpp b/sword_for_offer/codes/cpp/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.cpp
similarity index 100%
rename from cpp/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.cpp
diff --git a/cpp/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.cpp b/sword_for_offer/codes/cpp/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.cpp
similarity index 100%
rename from cpp/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.cpp
diff --git a/cpp/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.cpp b/sword_for_offer/codes/cpp/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.cpp
similarity index 100%
rename from cpp/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.cpp
diff --git a/cpp/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.cpp b/sword_for_offer/codes/cpp/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.cpp
similarity index 100%
rename from cpp/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.cpp
diff --git a/cpp/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.cpp b/sword_for_offer/codes/cpp/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.cpp
similarity index 100%
rename from cpp/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.cpp
diff --git a/cpp/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.cpp b/sword_for_offer/codes/cpp/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.cpp
similarity index 100%
rename from cpp/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.cpp
diff --git a/cpp/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.cpp b/sword_for_offer/codes/cpp/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.cpp
similarity index 100%
rename from cpp/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.cpp
diff --git a/cpp/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.cpp b/sword_for_offer/codes/cpp/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.cpp
similarity index 100%
rename from cpp/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.cpp
diff --git a/cpp/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.cpp b/sword_for_offer/codes/cpp/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.cpp
similarity index 100%
rename from cpp/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.cpp
diff --git a/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.cpp b/sword_for_offer/codes/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.cpp
similarity index 100%
rename from cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.cpp
diff --git a/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.cpp b/sword_for_offer/codes/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.cpp
similarity index 100%
rename from cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.cpp
diff --git a/cpp/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.cpp b/sword_for_offer/codes/cpp/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.cpp
similarity index 100%
rename from cpp/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.cpp
diff --git a/cpp/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.cpp b/sword_for_offer/codes/cpp/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.cpp
similarity index 100%
rename from cpp/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.cpp
diff --git a/cpp/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.cpp b/sword_for_offer/codes/cpp/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.cpp
similarity index 100%
rename from cpp/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.cpp
diff --git a/cpp/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.cpp
similarity index 100%
rename from cpp/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.cpp
diff --git a/cpp/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.cpp
similarity index 100%
rename from cpp/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.cpp
diff --git a/cpp/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.cpp b/sword_for_offer/codes/cpp/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.cpp
similarity index 100%
rename from cpp/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.cpp
diff --git a/cpp/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.cpp
similarity index 100%
rename from cpp/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.cpp
diff --git a/cpp/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.cpp b/sword_for_offer/codes/cpp/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.cpp
similarity index 100%
rename from cpp/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.cpp
diff --git a/cpp/sfo_30_min_stack_s1/sfo_30_min_stack_s1.cpp b/sword_for_offer/codes/cpp/sfo_30_min_stack_s1/sfo_30_min_stack_s1.cpp
similarity index 100%
rename from cpp/sfo_30_min_stack_s1/sfo_30_min_stack_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_30_min_stack_s1/sfo_30_min_stack_s1.cpp
diff --git a/cpp/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.cpp b/sword_for_offer/codes/cpp/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.cpp
similarity index 100%
rename from cpp/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.cpp
diff --git a/cpp/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.cpp b/sword_for_offer/codes/cpp/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.cpp
similarity index 100%
rename from cpp/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.cpp
diff --git a/cpp/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.cpp b/sword_for_offer/codes/cpp/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.cpp
similarity index 100%
rename from cpp/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.cpp
diff --git a/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.cpp b/sword_for_offer/codes/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.cpp
similarity index 100%
rename from cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.cpp
diff --git a/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.cpp b/sword_for_offer/codes/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.cpp
similarity index 100%
rename from cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.cpp
diff --git a/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.cpp
similarity index 100%
rename from cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.cpp
diff --git a/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.cpp b/sword_for_offer/codes/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.cpp
similarity index 100%
rename from cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.cpp
diff --git a/cpp/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.cpp
similarity index 100%
rename from cpp/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.cpp
diff --git a/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.cpp b/sword_for_offer/codes/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.cpp
similarity index 100%
rename from cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.cpp
diff --git a/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.cpp b/sword_for_offer/codes/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.cpp
similarity index 100%
rename from cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.cpp
diff --git a/cpp/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.cpp b/sword_for_offer/codes/cpp/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.cpp
similarity index 100%
rename from cpp/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.cpp
diff --git a/cpp/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.cpp
similarity index 100%
rename from cpp/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.cpp
diff --git a/cpp/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.cpp b/sword_for_offer/codes/cpp/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.cpp
similarity index 100%
rename from cpp/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.cpp
diff --git a/cpp/sfo_39_the_majority_element_in_an_array_s1/sfo_39_the_majority_element_in_an_array_s1.cpp b/sword_for_offer/codes/cpp/sfo_39_the_majority_element_in_an_array_s1/sfo_39_the_majority_element_in_an_array_s1.cpp
similarity index 100%
rename from cpp/sfo_39_the_majority_element_in_an_array_s1/sfo_39_the_majority_element_in_an_array_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_39_the_majority_element_in_an_array_s1/sfo_39_the_majority_element_in_an_array_s1.cpp
diff --git a/cpp/sfo_39_the_majority_element_in_an_array_s2/sfo_39_the_majority_element_in_an_array_s2.cpp b/sword_for_offer/codes/cpp/sfo_39_the_majority_element_in_an_array_s2/sfo_39_the_majority_element_in_an_array_s2.cpp
similarity index 100%
rename from cpp/sfo_39_the_majority_element_in_an_array_s2/sfo_39_the_majority_element_in_an_array_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_39_the_majority_element_in_an_array_s2/sfo_39_the_majority_element_in_an_array_s2.cpp
diff --git a/cpp/sfo_40_the_smallest_k_numbers_s1/sfo_40_the_smallest_k_numbers_s1.cpp b/sword_for_offer/codes/cpp/sfo_40_the_smallest_k_numbers_s1/sfo_40_the_smallest_k_numbers_s1.cpp
similarity index 100%
rename from cpp/sfo_40_the_smallest_k_numbers_s1/sfo_40_the_smallest_k_numbers_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_40_the_smallest_k_numbers_s1/sfo_40_the_smallest_k_numbers_s1.cpp
diff --git a/cpp/sfo_40_the_smallest_k_numbers_s2/sfo_40_the_smallest_k_numbers_s2.cpp b/sword_for_offer/codes/cpp/sfo_40_the_smallest_k_numbers_s2/sfo_40_the_smallest_k_numbers_s2.cpp
similarity index 100%
rename from cpp/sfo_40_the_smallest_k_numbers_s2/sfo_40_the_smallest_k_numbers_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_40_the_smallest_k_numbers_s2/sfo_40_the_smallest_k_numbers_s2.cpp
diff --git a/cpp/sfo_41_find_median_from_data_stream_s1/sfo_41_find_median_from_data_stream_s1.cpp b/sword_for_offer/codes/cpp/sfo_41_find_median_from_data_stream_s1/sfo_41_find_median_from_data_stream_s1.cpp
similarity index 100%
rename from cpp/sfo_41_find_median_from_data_stream_s1/sfo_41_find_median_from_data_stream_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_41_find_median_from_data_stream_s1/sfo_41_find_median_from_data_stream_s1.cpp
diff --git a/cpp/sfo_42_largest_sum_contiguous_subarray_s1/sfo_42_largest_sum_contiguous_subarray_s1.cpp b/sword_for_offer/codes/cpp/sfo_42_largest_sum_contiguous_subarray_s1/sfo_42_largest_sum_contiguous_subarray_s1.cpp
similarity index 100%
rename from cpp/sfo_42_largest_sum_contiguous_subarray_s1/sfo_42_largest_sum_contiguous_subarray_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_42_largest_sum_contiguous_subarray_s1/sfo_42_largest_sum_contiguous_subarray_s1.cpp
diff --git a/cpp/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.cpp b/sword_for_offer/codes/cpp/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.cpp
similarity index 100%
rename from cpp/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.cpp
diff --git a/cpp/sfo_44_nth_digit_s1/sfo_44_nth_digit_s1.cpp b/sword_for_offer/codes/cpp/sfo_44_nth_digit_s1/sfo_44_nth_digit_s1.cpp
similarity index 100%
rename from cpp/sfo_44_nth_digit_s1/sfo_44_nth_digit_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_44_nth_digit_s1/sfo_44_nth_digit_s1.cpp
diff --git a/cpp/sfo_45_arrange_an_array_into_the_smallest_number_s1/sfo_45_arrange_an_array_into_the_smallest_number_s1.cpp b/sword_for_offer/codes/cpp/sfo_45_arrange_an_array_into_the_smallest_number_s1/sfo_45_arrange_an_array_into_the_smallest_number_s1.cpp
similarity index 100%
rename from cpp/sfo_45_arrange_an_array_into_the_smallest_number_s1/sfo_45_arrange_an_array_into_the_smallest_number_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_45_arrange_an_array_into_the_smallest_number_s1/sfo_45_arrange_an_array_into_the_smallest_number_s1.cpp
diff --git a/cpp/sfo_45_arrange_an_array_into_the_smallest_number_s2/sfo_45_arrange_an_array_into_the_smallest_number_s2.cpp b/sword_for_offer/codes/cpp/sfo_45_arrange_an_array_into_the_smallest_number_s2/sfo_45_arrange_an_array_into_the_smallest_number_s2.cpp
similarity index 100%
rename from cpp/sfo_45_arrange_an_array_into_the_smallest_number_s2/sfo_45_arrange_an_array_into_the_smallest_number_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_45_arrange_an_array_into_the_smallest_number_s2/sfo_45_arrange_an_array_into_the_smallest_number_s2.cpp
diff --git a/cpp/sfo_46_translate_numbers_into_strings_s1/sfo_46_translate_numbers_into_strings_s1.cpp b/sword_for_offer/codes/cpp/sfo_46_translate_numbers_into_strings_s1/sfo_46_translate_numbers_into_strings_s1.cpp
similarity index 100%
rename from cpp/sfo_46_translate_numbers_into_strings_s1/sfo_46_translate_numbers_into_strings_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_46_translate_numbers_into_strings_s1/sfo_46_translate_numbers_into_strings_s1.cpp
diff --git a/cpp/sfo_46_translate_numbers_into_strings_s2/sfo_46_translate_numbers_into_strings_s2.cpp b/sword_for_offer/codes/cpp/sfo_46_translate_numbers_into_strings_s2/sfo_46_translate_numbers_into_strings_s2.cpp
similarity index 100%
rename from cpp/sfo_46_translate_numbers_into_strings_s2/sfo_46_translate_numbers_into_strings_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_46_translate_numbers_into_strings_s2/sfo_46_translate_numbers_into_strings_s2.cpp
diff --git a/cpp/sfo_46_translate_numbers_into_strings_s3/sfo_46_translate_numbers_into_strings_s3.cpp b/sword_for_offer/codes/cpp/sfo_46_translate_numbers_into_strings_s3/sfo_46_translate_numbers_into_strings_s3.cpp
similarity index 100%
rename from cpp/sfo_46_translate_numbers_into_strings_s3/sfo_46_translate_numbers_into_strings_s3.cpp
rename to sword_for_offer/codes/cpp/sfo_46_translate_numbers_into_strings_s3/sfo_46_translate_numbers_into_strings_s3.cpp
diff --git a/cpp/sfo_47_the_maximum_value_of_gifts_s1/sfo_47_the_maximum_value_of_gifts_s1.cpp b/sword_for_offer/codes/cpp/sfo_47_the_maximum_value_of_gifts_s1/sfo_47_the_maximum_value_of_gifts_s1.cpp
similarity index 100%
rename from cpp/sfo_47_the_maximum_value_of_gifts_s1/sfo_47_the_maximum_value_of_gifts_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_47_the_maximum_value_of_gifts_s1/sfo_47_the_maximum_value_of_gifts_s1.cpp
diff --git a/cpp/sfo_47_the_maximum_value_of_gifts_s2/sfo_47_the_maximum_value_of_gifts_s2.cpp b/sword_for_offer/codes/cpp/sfo_47_the_maximum_value_of_gifts_s2/sfo_47_the_maximum_value_of_gifts_s2.cpp
similarity index 100%
rename from cpp/sfo_47_the_maximum_value_of_gifts_s2/sfo_47_the_maximum_value_of_gifts_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_47_the_maximum_value_of_gifts_s2/sfo_47_the_maximum_value_of_gifts_s2.cpp
diff --git a/cpp/sfo_48_the_longest_substring_without_repeated_characters_s1/sfo_48_the_longest_substring_without_repeated_characters_s1.cpp b/sword_for_offer/codes/cpp/sfo_48_the_longest_substring_without_repeated_characters_s1/sfo_48_the_longest_substring_without_repeated_characters_s1.cpp
similarity index 100%
rename from cpp/sfo_48_the_longest_substring_without_repeated_characters_s1/sfo_48_the_longest_substring_without_repeated_characters_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_48_the_longest_substring_without_repeated_characters_s1/sfo_48_the_longest_substring_without_repeated_characters_s1.cpp
diff --git a/cpp/sfo_48_the_longest_substring_without_repeated_characters_s2/sfo_48_the_longest_substring_without_repeated_characters_s2.cpp b/sword_for_offer/codes/cpp/sfo_48_the_longest_substring_without_repeated_characters_s2/sfo_48_the_longest_substring_without_repeated_characters_s2.cpp
similarity index 100%
rename from cpp/sfo_48_the_longest_substring_without_repeated_characters_s2/sfo_48_the_longest_substring_without_repeated_characters_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_48_the_longest_substring_without_repeated_characters_s2/sfo_48_the_longest_substring_without_repeated_characters_s2.cpp
diff --git a/cpp/sfo_48_the_longest_substring_without_repeated_characters_s3/sfo_48_the_longest_substring_without_repeated_characters_s3.cpp b/sword_for_offer/codes/cpp/sfo_48_the_longest_substring_without_repeated_characters_s3/sfo_48_the_longest_substring_without_repeated_characters_s3.cpp
similarity index 100%
rename from cpp/sfo_48_the_longest_substring_without_repeated_characters_s3/sfo_48_the_longest_substring_without_repeated_characters_s3.cpp
rename to sword_for_offer/codes/cpp/sfo_48_the_longest_substring_without_repeated_characters_s3/sfo_48_the_longest_substring_without_repeated_characters_s3.cpp
diff --git a/cpp/sfo_49_ugly_numbers_s1/sfo_49_ugly_numbers_s1.cpp b/sword_for_offer/codes/cpp/sfo_49_ugly_numbers_s1/sfo_49_ugly_numbers_s1.cpp
similarity index 100%
rename from cpp/sfo_49_ugly_numbers_s1/sfo_49_ugly_numbers_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_49_ugly_numbers_s1/sfo_49_ugly_numbers_s1.cpp
diff --git a/cpp/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.cpp b/sword_for_offer/codes/cpp/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.cpp
similarity index 100%
rename from cpp/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.cpp
diff --git a/cpp/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.cpp b/sword_for_offer/codes/cpp/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.cpp
similarity index 100%
rename from cpp/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.cpp
diff --git a/cpp/sfo_51_reversed_pairs_in_an_array_s1/sfo_51_reversed_pairs_in_an_array_s1.cpp b/sword_for_offer/codes/cpp/sfo_51_reversed_pairs_in_an_array_s1/sfo_51_reversed_pairs_in_an_array_s1.cpp
similarity index 100%
rename from cpp/sfo_51_reversed_pairs_in_an_array_s1/sfo_51_reversed_pairs_in_an_array_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_51_reversed_pairs_in_an_array_s1/sfo_51_reversed_pairs_in_an_array_s1.cpp
diff --git a/cpp/sfo_52_the_first_common_node_in_two_linked_lists_s1/sfo_52_the_first_common_node_in_two_linked_lists_s1.cpp b/sword_for_offer/codes/cpp/sfo_52_the_first_common_node_in_two_linked_lists_s1/sfo_52_the_first_common_node_in_two_linked_lists_s1.cpp
similarity index 100%
rename from cpp/sfo_52_the_first_common_node_in_two_linked_lists_s1/sfo_52_the_first_common_node_in_two_linked_lists_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_52_the_first_common_node_in_two_linked_lists_s1/sfo_52_the_first_common_node_in_two_linked_lists_s1.cpp
diff --git a/cpp/sfo_53i_find_a_number_in_a_sorted_array_s1/sfo_53i_find_a_number_in_a_sorted_array_s1.cpp b/sword_for_offer/codes/cpp/sfo_53i_find_a_number_in_a_sorted_array_s1/sfo_53i_find_a_number_in_a_sorted_array_s1.cpp
similarity index 100%
rename from cpp/sfo_53i_find_a_number_in_a_sorted_array_s1/sfo_53i_find_a_number_in_a_sorted_array_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_53i_find_a_number_in_a_sorted_array_s1/sfo_53i_find_a_number_in_a_sorted_array_s1.cpp
diff --git a/cpp/sfo_53i_find_a_number_in_a_sorted_array_s2/sfo_53i_find_a_number_in_a_sorted_array_s2.cpp b/sword_for_offer/codes/cpp/sfo_53i_find_a_number_in_a_sorted_array_s2/sfo_53i_find_a_number_in_a_sorted_array_s2.cpp
similarity index 100%
rename from cpp/sfo_53i_find_a_number_in_a_sorted_array_s2/sfo_53i_find_a_number_in_a_sorted_array_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_53i_find_a_number_in_a_sorted_array_s2/sfo_53i_find_a_number_in_a_sorted_array_s2.cpp
diff --git a/cpp/sfo_53ii_the_missing_number_from_0_to_n1_s1/sfo_53ii_the_missing_number_from_0_to_n1_s1.cpp b/sword_for_offer/codes/cpp/sfo_53ii_the_missing_number_from_0_to_n1_s1/sfo_53ii_the_missing_number_from_0_to_n1_s1.cpp
similarity index 100%
rename from cpp/sfo_53ii_the_missing_number_from_0_to_n1_s1/sfo_53ii_the_missing_number_from_0_to_n1_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_53ii_the_missing_number_from_0_to_n1_s1/sfo_53ii_the_missing_number_from_0_to_n1_s1.cpp
diff --git a/cpp/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.cpp
similarity index 100%
rename from cpp/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.cpp
diff --git a/cpp/sfo_55i_depth_of_a_binary_tree_s1/sfo_55i_depth_of_a_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_55i_depth_of_a_binary_tree_s1/sfo_55i_depth_of_a_binary_tree_s1.cpp
similarity index 100%
rename from cpp/sfo_55i_depth_of_a_binary_tree_s1/sfo_55i_depth_of_a_binary_tree_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_55i_depth_of_a_binary_tree_s1/sfo_55i_depth_of_a_binary_tree_s1.cpp
diff --git a/cpp/sfo_55i_depth_of_a_binary_tree_s2/sfo_55i_depth_of_a_binary_tree_s2.cpp b/sword_for_offer/codes/cpp/sfo_55i_depth_of_a_binary_tree_s2/sfo_55i_depth_of_a_binary_tree_s2.cpp
similarity index 100%
rename from cpp/sfo_55i_depth_of_a_binary_tree_s2/sfo_55i_depth_of_a_binary_tree_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_55i_depth_of_a_binary_tree_s2/sfo_55i_depth_of_a_binary_tree_s2.cpp
diff --git a/cpp/sfo_55ii_balanced_binary_tree_s1/sfo_55ii_balanced_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_55ii_balanced_binary_tree_s1/sfo_55ii_balanced_binary_tree_s1.cpp
similarity index 100%
rename from cpp/sfo_55ii_balanced_binary_tree_s1/sfo_55ii_balanced_binary_tree_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_55ii_balanced_binary_tree_s1/sfo_55ii_balanced_binary_tree_s1.cpp
diff --git a/cpp/sfo_55ii_balanced_binary_tree_s2/sfo_55ii_balanced_binary_tree_s2.cpp b/sword_for_offer/codes/cpp/sfo_55ii_balanced_binary_tree_s2/sfo_55ii_balanced_binary_tree_s2.cpp
similarity index 100%
rename from cpp/sfo_55ii_balanced_binary_tree_s2/sfo_55ii_balanced_binary_tree_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_55ii_balanced_binary_tree_s2/sfo_55ii_balanced_binary_tree_s2.cpp
diff --git a/cpp/sfo_56i_single_number_i_s1/sfo_56i_single_number_i_s1.cpp b/sword_for_offer/codes/cpp/sfo_56i_single_number_i_s1/sfo_56i_single_number_i_s1.cpp
similarity index 100%
rename from cpp/sfo_56i_single_number_i_s1/sfo_56i_single_number_i_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_56i_single_number_i_s1/sfo_56i_single_number_i_s1.cpp
diff --git a/cpp/sfo_56ii_single_number_ii_s1/sfo_56ii_single_number_ii_s1.cpp b/sword_for_offer/codes/cpp/sfo_56ii_single_number_ii_s1/sfo_56ii_single_number_ii_s1.cpp
similarity index 100%
rename from cpp/sfo_56ii_single_number_ii_s1/sfo_56ii_single_number_ii_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_56ii_single_number_ii_s1/sfo_56ii_single_number_ii_s1.cpp
diff --git a/cpp/sfo_56ii_single_number_ii_s2/sfo_56ii_single_number_ii_s2.cpp b/sword_for_offer/codes/cpp/sfo_56ii_single_number_ii_s2/sfo_56ii_single_number_ii_s2.cpp
similarity index 100%
rename from cpp/sfo_56ii_single_number_ii_s2/sfo_56ii_single_number_ii_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_56ii_single_number_ii_s2/sfo_56ii_single_number_ii_s2.cpp
diff --git a/cpp/sfo_57_two_numbers_with_sum_s_s1/sfo_57_two_numbers_with_sum_s_s1.cpp b/sword_for_offer/codes/cpp/sfo_57_two_numbers_with_sum_s_s1/sfo_57_two_numbers_with_sum_s_s1.cpp
similarity index 100%
rename from cpp/sfo_57_two_numbers_with_sum_s_s1/sfo_57_two_numbers_with_sum_s_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_57_two_numbers_with_sum_s_s1/sfo_57_two_numbers_with_sum_s_s1.cpp
diff --git a/cpp/sfo_57ii_consecutive_numbers_with_sum_s_s1/sfo_57ii_consecutive_numbers_with_sum_s_s1.cpp b/sword_for_offer/codes/cpp/sfo_57ii_consecutive_numbers_with_sum_s_s1/sfo_57ii_consecutive_numbers_with_sum_s_s1.cpp
similarity index 100%
rename from cpp/sfo_57ii_consecutive_numbers_with_sum_s_s1/sfo_57ii_consecutive_numbers_with_sum_s_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_57ii_consecutive_numbers_with_sum_s_s1/sfo_57ii_consecutive_numbers_with_sum_s_s1.cpp
diff --git a/cpp/sfo_57ii_consecutive_numbers_with_sum_s_s2/sfo_57ii_consecutive_numbers_with_sum_s_s2.cpp b/sword_for_offer/codes/cpp/sfo_57ii_consecutive_numbers_with_sum_s_s2/sfo_57ii_consecutive_numbers_with_sum_s_s2.cpp
similarity index 100%
rename from cpp/sfo_57ii_consecutive_numbers_with_sum_s_s2/sfo_57ii_consecutive_numbers_with_sum_s_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_57ii_consecutive_numbers_with_sum_s_s2/sfo_57ii_consecutive_numbers_with_sum_s_s2.cpp
diff --git a/cpp/sfo_58ii_left_rotation_of_a_string_s1/sfo_58ii_left_rotation_of_a_string_s1.cpp b/sword_for_offer/codes/cpp/sfo_58ii_left_rotation_of_a_string_s1/sfo_58ii_left_rotation_of_a_string_s1.cpp
similarity index 100%
rename from cpp/sfo_58ii_left_rotation_of_a_string_s1/sfo_58ii_left_rotation_of_a_string_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_58ii_left_rotation_of_a_string_s1/sfo_58ii_left_rotation_of_a_string_s1.cpp
diff --git a/cpp/sfo_58ii_left_rotation_of_a_string_s2/sfo_58ii_left_rotation_of_a_string_s2.cpp b/sword_for_offer/codes/cpp/sfo_58ii_left_rotation_of_a_string_s2/sfo_58ii_left_rotation_of_a_string_s2.cpp
similarity index 100%
rename from cpp/sfo_58ii_left_rotation_of_a_string_s2/sfo_58ii_left_rotation_of_a_string_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_58ii_left_rotation_of_a_string_s2/sfo_58ii_left_rotation_of_a_string_s2.cpp
diff --git a/cpp/sfo_58ii_left_rotation_of_a_string_s3/sfo_58ii_left_rotation_of_a_string_s3.cpp b/sword_for_offer/codes/cpp/sfo_58ii_left_rotation_of_a_string_s3/sfo_58ii_left_rotation_of_a_string_s3.cpp
similarity index 100%
rename from cpp/sfo_58ii_left_rotation_of_a_string_s3/sfo_58ii_left_rotation_of_a_string_s3.cpp
rename to sword_for_offer/codes/cpp/sfo_58ii_left_rotation_of_a_string_s3/sfo_58ii_left_rotation_of_a_string_s3.cpp
diff --git a/cpp/sfo_59ii_max_queue_s1/sfo_59ii_max_queue_s1.cpp b/sword_for_offer/codes/cpp/sfo_59ii_max_queue_s1/sfo_59ii_max_queue_s1.cpp
similarity index 100%
rename from cpp/sfo_59ii_max_queue_s1/sfo_59ii_max_queue_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_59ii_max_queue_s1/sfo_59ii_max_queue_s1.cpp
diff --git a/cpp/sfo_60_probabilities_for_rolling_n_dices_s1/sfo_60_probabilities_for_rolling_n_dices_s1.cpp b/sword_for_offer/codes/cpp/sfo_60_probabilities_for_rolling_n_dices_s1/sfo_60_probabilities_for_rolling_n_dices_s1.cpp
similarity index 100%
rename from cpp/sfo_60_probabilities_for_rolling_n_dices_s1/sfo_60_probabilities_for_rolling_n_dices_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_60_probabilities_for_rolling_n_dices_s1/sfo_60_probabilities_for_rolling_n_dices_s1.cpp
diff --git a/cpp/sfo_61_straight_in_poker_s1/sfo_61_straight_in_poker_s1.cpp b/sword_for_offer/codes/cpp/sfo_61_straight_in_poker_s1/sfo_61_straight_in_poker_s1.cpp
similarity index 100%
rename from cpp/sfo_61_straight_in_poker_s1/sfo_61_straight_in_poker_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_61_straight_in_poker_s1/sfo_61_straight_in_poker_s1.cpp
diff --git a/cpp/sfo_61_straight_in_poker_s2/sfo_61_straight_in_poker_s2.cpp b/sword_for_offer/codes/cpp/sfo_61_straight_in_poker_s2/sfo_61_straight_in_poker_s2.cpp
similarity index 100%
rename from cpp/sfo_61_straight_in_poker_s2/sfo_61_straight_in_poker_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_61_straight_in_poker_s2/sfo_61_straight_in_poker_s2.cpp
diff --git a/cpp/sfo_62_josephus_problem_s1/sfo_62_josephus_problem_s1.cpp b/sword_for_offer/codes/cpp/sfo_62_josephus_problem_s1/sfo_62_josephus_problem_s1.cpp
similarity index 100%
rename from cpp/sfo_62_josephus_problem_s1/sfo_62_josephus_problem_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_62_josephus_problem_s1/sfo_62_josephus_problem_s1.cpp
diff --git a/cpp/sfo_63_the_maximum_profit_of_stocks_s1/sfo_63_the_maximum_profit_of_stocks_s1.cpp b/sword_for_offer/codes/cpp/sfo_63_the_maximum_profit_of_stocks_s1/sfo_63_the_maximum_profit_of_stocks_s1.cpp
similarity index 100%
rename from cpp/sfo_63_the_maximum_profit_of_stocks_s1/sfo_63_the_maximum_profit_of_stocks_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_63_the_maximum_profit_of_stocks_s1/sfo_63_the_maximum_profit_of_stocks_s1.cpp
diff --git a/cpp/sfo_64_solve_1_2___n_s1/sfo_64_solve_1_2___n_s1.cpp b/sword_for_offer/codes/cpp/sfo_64_solve_1_2___n_s1/sfo_64_solve_1_2___n_s1.cpp
similarity index 100%
rename from cpp/sfo_64_solve_1_2___n_s1/sfo_64_solve_1_2___n_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_64_solve_1_2___n_s1/sfo_64_solve_1_2___n_s1.cpp
diff --git a/cpp/sfo_65_implement_addition_operation_without_arithmetic_operators_s1/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.cpp b/sword_for_offer/codes/cpp/sfo_65_implement_addition_operation_without_arithmetic_operators_s1/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.cpp
similarity index 100%
rename from cpp/sfo_65_implement_addition_operation_without_arithmetic_operators_s1/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_65_implement_addition_operation_without_arithmetic_operators_s1/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.cpp
diff --git a/cpp/sfo_66_a_product_array_puzzle_s1/sfo_66_a_product_array_puzzle_s1.cpp b/sword_for_offer/codes/cpp/sfo_66_a_product_array_puzzle_s1/sfo_66_a_product_array_puzzle_s1.cpp
similarity index 100%
rename from cpp/sfo_66_a_product_array_puzzle_s1/sfo_66_a_product_array_puzzle_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_66_a_product_array_puzzle_s1/sfo_66_a_product_array_puzzle_s1.cpp
diff --git a/cpp/sfo_67_convert_string_to_int_s1/sfo_67_convert_string_to_int_s1.cpp b/sword_for_offer/codes/cpp/sfo_67_convert_string_to_int_s1/sfo_67_convert_string_to_int_s1.cpp
similarity index 100%
rename from cpp/sfo_67_convert_string_to_int_s1/sfo_67_convert_string_to_int_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_67_convert_string_to_int_s1/sfo_67_convert_string_to_int_s1.cpp
diff --git a/cpp/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.cpp
similarity index 100%
rename from cpp/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.cpp
diff --git a/cpp/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.cpp b/sword_for_offer/codes/cpp/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.cpp
similarity index 100%
rename from cpp/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.cpp
diff --git a/cpp/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.cpp b/sword_for_offer/codes/cpp/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.cpp
similarity index 100%
rename from cpp/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.cpp
rename to sword_for_offer/codes/cpp/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.cpp
diff --git a/cpp/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.cpp
similarity index 100%
rename from cpp/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.cpp
rename to sword_for_offer/codes/cpp/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.cpp
diff --git a/cpp/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.cpp b/sword_for_offer/codes/cpp/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.cpp
similarity index 100%
rename from cpp/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.cpp
rename to sword_for_offer/codes/cpp/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.cpp
diff --git a/java/include/ListNode.java b/sword_for_offer/codes/java/include/ListNode.java
similarity index 100%
rename from java/include/ListNode.java
rename to sword_for_offer/codes/java/include/ListNode.java
diff --git a/java/include/PrintUtil.java b/sword_for_offer/codes/java/include/PrintUtil.java
similarity index 100%
rename from java/include/PrintUtil.java
rename to sword_for_offer/codes/java/include/PrintUtil.java
diff --git a/java/include/TreeNode.java b/sword_for_offer/codes/java/include/TreeNode.java
similarity index 100%
rename from java/include/TreeNode.java
rename to sword_for_offer/codes/java/include/TreeNode.java
diff --git a/java/sfo_03_find_duplicate_numbers_in_an_array_s1/sfo_03_find_duplicate_numbers_in_an_array_s1.java b/sword_for_offer/codes/java/sfo_03_find_duplicate_numbers_in_an_array_s1/sfo_03_find_duplicate_numbers_in_an_array_s1.java
similarity index 100%
rename from java/sfo_03_find_duplicate_numbers_in_an_array_s1/sfo_03_find_duplicate_numbers_in_an_array_s1.java
rename to sword_for_offer/codes/java/sfo_03_find_duplicate_numbers_in_an_array_s1/sfo_03_find_duplicate_numbers_in_an_array_s1.java
diff --git a/java/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.java b/sword_for_offer/codes/java/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.java
similarity index 100%
rename from java/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.java
rename to sword_for_offer/codes/java/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.java
diff --git a/java/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.java b/sword_for_offer/codes/java/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.java
similarity index 100%
rename from java/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.java
rename to sword_for_offer/codes/java/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.java
diff --git a/java/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.java b/sword_for_offer/codes/java/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.java
similarity index 100%
rename from java/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.java
rename to sword_for_offer/codes/java/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.java
diff --git a/java/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.java b/sword_for_offer/codes/java/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.java
similarity index 100%
rename from java/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.java
rename to sword_for_offer/codes/java/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.java
diff --git a/java/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.java b/sword_for_offer/codes/java/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.java
similarity index 100%
rename from java/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.java
rename to sword_for_offer/codes/java/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.java
diff --git a/java/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.java b/sword_for_offer/codes/java/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.java
similarity index 100%
rename from java/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.java
rename to sword_for_offer/codes/java/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.java
diff --git a/java/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.java b/sword_for_offer/codes/java/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.java
similarity index 100%
rename from java/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.java
rename to sword_for_offer/codes/java/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.java
diff --git a/java/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.java b/sword_for_offer/codes/java/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.java
similarity index 100%
rename from java/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.java
rename to sword_for_offer/codes/java/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.java
diff --git a/java/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.java b/sword_for_offer/codes/java/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.java
similarity index 100%
rename from java/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.java
rename to sword_for_offer/codes/java/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.java
diff --git a/java/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.java b/sword_for_offer/codes/java/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.java
similarity index 100%
rename from java/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.java
rename to sword_for_offer/codes/java/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.java
diff --git a/java/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.java b/sword_for_offer/codes/java/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.java
similarity index 100%
rename from java/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.java
rename to sword_for_offer/codes/java/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.java
diff --git a/java/sfo_12_word_search_s1/sfo_12_word_search_s1.java b/sword_for_offer/codes/java/sfo_12_word_search_s1/sfo_12_word_search_s1.java
similarity index 100%
rename from java/sfo_12_word_search_s1/sfo_12_word_search_s1.java
rename to sword_for_offer/codes/java/sfo_12_word_search_s1/sfo_12_word_search_s1.java
diff --git a/java/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.java b/sword_for_offer/codes/java/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.java
similarity index 100%
rename from java/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.java
rename to sword_for_offer/codes/java/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.java
diff --git a/java/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.java b/sword_for_offer/codes/java/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.java
similarity index 100%
rename from java/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.java
rename to sword_for_offer/codes/java/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.java
diff --git a/java/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.java b/sword_for_offer/codes/java/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.java
similarity index 100%
rename from java/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.java
rename to sword_for_offer/codes/java/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.java
diff --git a/java/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.java b/sword_for_offer/codes/java/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.java
similarity index 100%
rename from java/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.java
rename to sword_for_offer/codes/java/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.java
diff --git a/java/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.java b/sword_for_offer/codes/java/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.java
similarity index 100%
rename from java/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.java
rename to sword_for_offer/codes/java/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.java
diff --git a/java/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.java b/sword_for_offer/codes/java/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.java
similarity index 100%
rename from java/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.java
rename to sword_for_offer/codes/java/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.java
diff --git a/java/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.java b/sword_for_offer/codes/java/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.java
similarity index 100%
rename from java/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.java
rename to sword_for_offer/codes/java/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.java
diff --git a/java/sfo_17_print_from_1_to_the_largest_n_digits_s1/sfo_17_print_from_1_to_the_largest_n_digits_s1.java b/sword_for_offer/codes/java/sfo_17_print_from_1_to_the_largest_n_digits_s1/sfo_17_print_from_1_to_the_largest_n_digits_s1.java
similarity index 100%
rename from java/sfo_17_print_from_1_to_the_largest_n_digits_s1/sfo_17_print_from_1_to_the_largest_n_digits_s1.java
rename to sword_for_offer/codes/java/sfo_17_print_from_1_to_the_largest_n_digits_s1/sfo_17_print_from_1_to_the_largest_n_digits_s1.java
diff --git a/java/sfo_17_print_from_1_to_the_largest_n_digits_s2/sfo_17_print_from_1_to_the_largest_n_digits_s2.java b/sword_for_offer/codes/java/sfo_17_print_from_1_to_the_largest_n_digits_s2/sfo_17_print_from_1_to_the_largest_n_digits_s2.java
similarity index 100%
rename from java/sfo_17_print_from_1_to_the_largest_n_digits_s2/sfo_17_print_from_1_to_the_largest_n_digits_s2.java
rename to sword_for_offer/codes/java/sfo_17_print_from_1_to_the_largest_n_digits_s2/sfo_17_print_from_1_to_the_largest_n_digits_s2.java
diff --git a/java/sfo_17_print_from_1_to_the_largest_n_digits_s3/sfo_17_print_from_1_to_the_largest_n_digits_s3.java b/sword_for_offer/codes/java/sfo_17_print_from_1_to_the_largest_n_digits_s3/sfo_17_print_from_1_to_the_largest_n_digits_s3.java
similarity index 100%
rename from java/sfo_17_print_from_1_to_the_largest_n_digits_s3/sfo_17_print_from_1_to_the_largest_n_digits_s3.java
rename to sword_for_offer/codes/java/sfo_17_print_from_1_to_the_largest_n_digits_s3/sfo_17_print_from_1_to_the_largest_n_digits_s3.java
diff --git a/java/sfo_17_print_from_1_to_the_largest_n_digits_s4/sfo_17_print_from_1_to_the_largest_n_digits_s4.java b/sword_for_offer/codes/java/sfo_17_print_from_1_to_the_largest_n_digits_s4/sfo_17_print_from_1_to_the_largest_n_digits_s4.java
similarity index 100%
rename from java/sfo_17_print_from_1_to_the_largest_n_digits_s4/sfo_17_print_from_1_to_the_largest_n_digits_s4.java
rename to sword_for_offer/codes/java/sfo_17_print_from_1_to_the_largest_n_digits_s4/sfo_17_print_from_1_to_the_largest_n_digits_s4.java
diff --git a/java/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.java b/sword_for_offer/codes/java/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.java
similarity index 100%
rename from java/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.java
rename to sword_for_offer/codes/java/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.java
diff --git a/java/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.java b/sword_for_offer/codes/java/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.java
similarity index 100%
rename from java/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.java
rename to sword_for_offer/codes/java/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.java
diff --git a/java/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.java b/sword_for_offer/codes/java/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.java
similarity index 100%
rename from java/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.java
rename to sword_for_offer/codes/java/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.java
diff --git a/java/sfo_20_a_string_representing_a_numeric_value_s1/sfo_20_a_string_representing_a_numeric_value_s1.java b/sword_for_offer/codes/java/sfo_20_a_string_representing_a_numeric_value_s1/sfo_20_a_string_representing_a_numeric_value_s1.java
similarity index 100%
rename from java/sfo_20_a_string_representing_a_numeric_value_s1/sfo_20_a_string_representing_a_numeric_value_s1.java
rename to sword_for_offer/codes/java/sfo_20_a_string_representing_a_numeric_value_s1/sfo_20_a_string_representing_a_numeric_value_s1.java
diff --git a/java/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.java b/sword_for_offer/codes/java/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.java
similarity index 100%
rename from java/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.java
rename to sword_for_offer/codes/java/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.java
diff --git a/java/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.java b/sword_for_offer/codes/java/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.java
similarity index 100%
rename from java/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.java
rename to sword_for_offer/codes/java/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.java
diff --git a/java/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.java b/sword_for_offer/codes/java/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.java
similarity index 100%
rename from java/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.java
rename to sword_for_offer/codes/java/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.java
diff --git a/java/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.java b/sword_for_offer/codes/java/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.java
similarity index 100%
rename from java/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.java
rename to sword_for_offer/codes/java/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.java
diff --git a/java/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.java b/sword_for_offer/codes/java/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.java
similarity index 100%
rename from java/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.java
rename to sword_for_offer/codes/java/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.java
diff --git a/java/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.java b/sword_for_offer/codes/java/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.java
similarity index 100%
rename from java/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.java
rename to sword_for_offer/codes/java/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.java
diff --git a/java/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.java b/sword_for_offer/codes/java/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.java
similarity index 100%
rename from java/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.java
rename to sword_for_offer/codes/java/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.java
diff --git a/java/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.java b/sword_for_offer/codes/java/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.java
similarity index 100%
rename from java/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.java
rename to sword_for_offer/codes/java/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.java
diff --git a/java/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.java b/sword_for_offer/codes/java/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.java
similarity index 100%
rename from java/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.java
rename to sword_for_offer/codes/java/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.java
diff --git a/java/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.java b/sword_for_offer/codes/java/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.java
similarity index 100%
rename from java/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.java
rename to sword_for_offer/codes/java/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.java
diff --git a/java/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.java b/sword_for_offer/codes/java/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.java
similarity index 100%
rename from java/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.java
rename to sword_for_offer/codes/java/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.java
diff --git a/java/sfo_30_min_stack_s1/sfo_30_min_stack_s1.java b/sword_for_offer/codes/java/sfo_30_min_stack_s1/sfo_30_min_stack_s1.java
similarity index 100%
rename from java/sfo_30_min_stack_s1/sfo_30_min_stack_s1.java
rename to sword_for_offer/codes/java/sfo_30_min_stack_s1/sfo_30_min_stack_s1.java
diff --git a/java/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.java b/sword_for_offer/codes/java/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.java
similarity index 100%
rename from java/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.java
rename to sword_for_offer/codes/java/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.java
diff --git a/java/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.java b/sword_for_offer/codes/java/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.java
similarity index 100%
rename from java/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.java
rename to sword_for_offer/codes/java/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.java
diff --git a/java/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.java b/sword_for_offer/codes/java/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.java
similarity index 100%
rename from java/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.java
rename to sword_for_offer/codes/java/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.java
diff --git a/java/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.java b/sword_for_offer/codes/java/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.java
similarity index 100%
rename from java/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.java
rename to sword_for_offer/codes/java/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.java
diff --git a/java/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.java b/sword_for_offer/codes/java/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.java
similarity index 100%
rename from java/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.java
rename to sword_for_offer/codes/java/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.java
diff --git a/java/sfo_32iii_print_a_binary_tree_topbottom_iii_s3/sfo_32iii_print_a_binary_tree_topbottom_iii_s3.java b/sword_for_offer/codes/java/sfo_32iii_print_a_binary_tree_topbottom_iii_s3/sfo_32iii_print_a_binary_tree_topbottom_iii_s3.java
similarity index 100%
rename from java/sfo_32iii_print_a_binary_tree_topbottom_iii_s3/sfo_32iii_print_a_binary_tree_topbottom_iii_s3.java
rename to sword_for_offer/codes/java/sfo_32iii_print_a_binary_tree_topbottom_iii_s3/sfo_32iii_print_a_binary_tree_topbottom_iii_s3.java
diff --git a/java/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.java b/sword_for_offer/codes/java/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.java
similarity index 100%
rename from java/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.java
rename to sword_for_offer/codes/java/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.java
diff --git a/java/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.java b/sword_for_offer/codes/java/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.java
similarity index 100%
rename from java/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.java
rename to sword_for_offer/codes/java/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.java
diff --git a/java/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.java b/sword_for_offer/codes/java/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.java
similarity index 100%
rename from java/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.java
rename to sword_for_offer/codes/java/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.java
diff --git a/java/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.java b/sword_for_offer/codes/java/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.java
similarity index 100%
rename from java/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.java
rename to sword_for_offer/codes/java/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.java
diff --git a/java/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.java b/sword_for_offer/codes/java/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.java
similarity index 100%
rename from java/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.java
rename to sword_for_offer/codes/java/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.java
diff --git a/java/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.java b/sword_for_offer/codes/java/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.java
similarity index 100%
rename from java/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.java
rename to sword_for_offer/codes/java/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.java
diff --git a/java/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.java b/sword_for_offer/codes/java/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.java
similarity index 100%
rename from java/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.java
rename to sword_for_offer/codes/java/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.java
diff --git a/java/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.java b/sword_for_offer/codes/java/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.java
similarity index 100%
rename from java/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.java
rename to sword_for_offer/codes/java/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.java
diff --git a/java/sfo_39_the_majority_element_in_an_array_s1/sfo_39_the_majority_element_in_an_array_s1.java b/sword_for_offer/codes/java/sfo_39_the_majority_element_in_an_array_s1/sfo_39_the_majority_element_in_an_array_s1.java
similarity index 100%
rename from java/sfo_39_the_majority_element_in_an_array_s1/sfo_39_the_majority_element_in_an_array_s1.java
rename to sword_for_offer/codes/java/sfo_39_the_majority_element_in_an_array_s1/sfo_39_the_majority_element_in_an_array_s1.java
diff --git a/java/sfo_39_the_majority_element_in_an_array_s2/sfo_39_the_majority_element_in_an_array_s2.java b/sword_for_offer/codes/java/sfo_39_the_majority_element_in_an_array_s2/sfo_39_the_majority_element_in_an_array_s2.java
similarity index 100%
rename from java/sfo_39_the_majority_element_in_an_array_s2/sfo_39_the_majority_element_in_an_array_s2.java
rename to sword_for_offer/codes/java/sfo_39_the_majority_element_in_an_array_s2/sfo_39_the_majority_element_in_an_array_s2.java
diff --git a/java/sfo_40_the_smallest_k_numbers_s1/sfo_40_the_smallest_k_numbers_s1.java b/sword_for_offer/codes/java/sfo_40_the_smallest_k_numbers_s1/sfo_40_the_smallest_k_numbers_s1.java
similarity index 100%
rename from java/sfo_40_the_smallest_k_numbers_s1/sfo_40_the_smallest_k_numbers_s1.java
rename to sword_for_offer/codes/java/sfo_40_the_smallest_k_numbers_s1/sfo_40_the_smallest_k_numbers_s1.java
diff --git a/java/sfo_40_the_smallest_k_numbers_s2/sfo_40_the_smallest_k_numbers_s2.java b/sword_for_offer/codes/java/sfo_40_the_smallest_k_numbers_s2/sfo_40_the_smallest_k_numbers_s2.java
similarity index 100%
rename from java/sfo_40_the_smallest_k_numbers_s2/sfo_40_the_smallest_k_numbers_s2.java
rename to sword_for_offer/codes/java/sfo_40_the_smallest_k_numbers_s2/sfo_40_the_smallest_k_numbers_s2.java
diff --git a/java/sfo_41_find_median_from_data_stream_s1/sfo_41_find_median_from_data_stream_s1.java b/sword_for_offer/codes/java/sfo_41_find_median_from_data_stream_s1/sfo_41_find_median_from_data_stream_s1.java
similarity index 100%
rename from java/sfo_41_find_median_from_data_stream_s1/sfo_41_find_median_from_data_stream_s1.java
rename to sword_for_offer/codes/java/sfo_41_find_median_from_data_stream_s1/sfo_41_find_median_from_data_stream_s1.java
diff --git a/java/sfo_42_largest_sum_contiguous_subarray_s1/sfo_42_largest_sum_contiguous_subarray_s1.java b/sword_for_offer/codes/java/sfo_42_largest_sum_contiguous_subarray_s1/sfo_42_largest_sum_contiguous_subarray_s1.java
similarity index 100%
rename from java/sfo_42_largest_sum_contiguous_subarray_s1/sfo_42_largest_sum_contiguous_subarray_s1.java
rename to sword_for_offer/codes/java/sfo_42_largest_sum_contiguous_subarray_s1/sfo_42_largest_sum_contiguous_subarray_s1.java
diff --git a/java/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.java b/sword_for_offer/codes/java/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.java
similarity index 100%
rename from java/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.java
rename to sword_for_offer/codes/java/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.java
diff --git a/java/sfo_44_nth_digit_s1/sfo_44_nth_digit_s1.java b/sword_for_offer/codes/java/sfo_44_nth_digit_s1/sfo_44_nth_digit_s1.java
similarity index 100%
rename from java/sfo_44_nth_digit_s1/sfo_44_nth_digit_s1.java
rename to sword_for_offer/codes/java/sfo_44_nth_digit_s1/sfo_44_nth_digit_s1.java
diff --git a/java/sfo_45_arrange_an_array_into_the_smallest_number_s1/sfo_45_arrange_an_array_into_the_smallest_number_s1.java b/sword_for_offer/codes/java/sfo_45_arrange_an_array_into_the_smallest_number_s1/sfo_45_arrange_an_array_into_the_smallest_number_s1.java
similarity index 100%
rename from java/sfo_45_arrange_an_array_into_the_smallest_number_s1/sfo_45_arrange_an_array_into_the_smallest_number_s1.java
rename to sword_for_offer/codes/java/sfo_45_arrange_an_array_into_the_smallest_number_s1/sfo_45_arrange_an_array_into_the_smallest_number_s1.java
diff --git a/java/sfo_45_arrange_an_array_into_the_smallest_number_s2/sfo_45_arrange_an_array_into_the_smallest_number_s2.java b/sword_for_offer/codes/java/sfo_45_arrange_an_array_into_the_smallest_number_s2/sfo_45_arrange_an_array_into_the_smallest_number_s2.java
similarity index 100%
rename from java/sfo_45_arrange_an_array_into_the_smallest_number_s2/sfo_45_arrange_an_array_into_the_smallest_number_s2.java
rename to sword_for_offer/codes/java/sfo_45_arrange_an_array_into_the_smallest_number_s2/sfo_45_arrange_an_array_into_the_smallest_number_s2.java
diff --git a/java/sfo_46_translate_numbers_into_strings_s1/sfo_46_translate_numbers_into_strings_s1.java b/sword_for_offer/codes/java/sfo_46_translate_numbers_into_strings_s1/sfo_46_translate_numbers_into_strings_s1.java
similarity index 100%
rename from java/sfo_46_translate_numbers_into_strings_s1/sfo_46_translate_numbers_into_strings_s1.java
rename to sword_for_offer/codes/java/sfo_46_translate_numbers_into_strings_s1/sfo_46_translate_numbers_into_strings_s1.java
diff --git a/java/sfo_46_translate_numbers_into_strings_s2/sfo_46_translate_numbers_into_strings_s2.java b/sword_for_offer/codes/java/sfo_46_translate_numbers_into_strings_s2/sfo_46_translate_numbers_into_strings_s2.java
similarity index 100%
rename from java/sfo_46_translate_numbers_into_strings_s2/sfo_46_translate_numbers_into_strings_s2.java
rename to sword_for_offer/codes/java/sfo_46_translate_numbers_into_strings_s2/sfo_46_translate_numbers_into_strings_s2.java
diff --git a/java/sfo_46_translate_numbers_into_strings_s3/sfo_46_translate_numbers_into_strings_s3.java b/sword_for_offer/codes/java/sfo_46_translate_numbers_into_strings_s3/sfo_46_translate_numbers_into_strings_s3.java
similarity index 100%
rename from java/sfo_46_translate_numbers_into_strings_s3/sfo_46_translate_numbers_into_strings_s3.java
rename to sword_for_offer/codes/java/sfo_46_translate_numbers_into_strings_s3/sfo_46_translate_numbers_into_strings_s3.java
diff --git a/java/sfo_47_the_maximum_value_of_gifts_s1/sfo_47_the_maximum_value_of_gifts_s1.java b/sword_for_offer/codes/java/sfo_47_the_maximum_value_of_gifts_s1/sfo_47_the_maximum_value_of_gifts_s1.java
similarity index 100%
rename from java/sfo_47_the_maximum_value_of_gifts_s1/sfo_47_the_maximum_value_of_gifts_s1.java
rename to sword_for_offer/codes/java/sfo_47_the_maximum_value_of_gifts_s1/sfo_47_the_maximum_value_of_gifts_s1.java
diff --git a/java/sfo_47_the_maximum_value_of_gifts_s2/sfo_47_the_maximum_value_of_gifts_s2.java b/sword_for_offer/codes/java/sfo_47_the_maximum_value_of_gifts_s2/sfo_47_the_maximum_value_of_gifts_s2.java
similarity index 100%
rename from java/sfo_47_the_maximum_value_of_gifts_s2/sfo_47_the_maximum_value_of_gifts_s2.java
rename to sword_for_offer/codes/java/sfo_47_the_maximum_value_of_gifts_s2/sfo_47_the_maximum_value_of_gifts_s2.java
diff --git a/java/sfo_48_the_longest_substring_without_repeated_characters_s1/sfo_48_the_longest_substring_without_repeated_characters_s1.java b/sword_for_offer/codes/java/sfo_48_the_longest_substring_without_repeated_characters_s1/sfo_48_the_longest_substring_without_repeated_characters_s1.java
similarity index 100%
rename from java/sfo_48_the_longest_substring_without_repeated_characters_s1/sfo_48_the_longest_substring_without_repeated_characters_s1.java
rename to sword_for_offer/codes/java/sfo_48_the_longest_substring_without_repeated_characters_s1/sfo_48_the_longest_substring_without_repeated_characters_s1.java
diff --git a/java/sfo_48_the_longest_substring_without_repeated_characters_s2/sfo_48_the_longest_substring_without_repeated_characters_s2.java b/sword_for_offer/codes/java/sfo_48_the_longest_substring_without_repeated_characters_s2/sfo_48_the_longest_substring_without_repeated_characters_s2.java
similarity index 100%
rename from java/sfo_48_the_longest_substring_without_repeated_characters_s2/sfo_48_the_longest_substring_without_repeated_characters_s2.java
rename to sword_for_offer/codes/java/sfo_48_the_longest_substring_without_repeated_characters_s2/sfo_48_the_longest_substring_without_repeated_characters_s2.java
diff --git a/java/sfo_48_the_longest_substring_without_repeated_characters_s3/sfo_48_the_longest_substring_without_repeated_characters_s3.java b/sword_for_offer/codes/java/sfo_48_the_longest_substring_without_repeated_characters_s3/sfo_48_the_longest_substring_without_repeated_characters_s3.java
similarity index 100%
rename from java/sfo_48_the_longest_substring_without_repeated_characters_s3/sfo_48_the_longest_substring_without_repeated_characters_s3.java
rename to sword_for_offer/codes/java/sfo_48_the_longest_substring_without_repeated_characters_s3/sfo_48_the_longest_substring_without_repeated_characters_s3.java
diff --git a/java/sfo_49_ugly_numbers_s1/sfo_49_ugly_numbers_s1.java b/sword_for_offer/codes/java/sfo_49_ugly_numbers_s1/sfo_49_ugly_numbers_s1.java
similarity index 100%
rename from java/sfo_49_ugly_numbers_s1/sfo_49_ugly_numbers_s1.java
rename to sword_for_offer/codes/java/sfo_49_ugly_numbers_s1/sfo_49_ugly_numbers_s1.java
diff --git a/java/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.java b/sword_for_offer/codes/java/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.java
similarity index 100%
rename from java/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.java
rename to sword_for_offer/codes/java/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.java
diff --git a/java/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.java b/sword_for_offer/codes/java/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.java
similarity index 100%
rename from java/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.java
rename to sword_for_offer/codes/java/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.java
diff --git a/java/sfo_51_reversed_pairs_in_an_array_s1/sfo_51_reversed_pairs_in_an_array_s1.java b/sword_for_offer/codes/java/sfo_51_reversed_pairs_in_an_array_s1/sfo_51_reversed_pairs_in_an_array_s1.java
similarity index 100%
rename from java/sfo_51_reversed_pairs_in_an_array_s1/sfo_51_reversed_pairs_in_an_array_s1.java
rename to sword_for_offer/codes/java/sfo_51_reversed_pairs_in_an_array_s1/sfo_51_reversed_pairs_in_an_array_s1.java
diff --git a/java/sfo_52_the_first_common_node_in_two_linked_lists_s1/sfo_52_the_first_common_node_in_two_linked_lists_s1.java b/sword_for_offer/codes/java/sfo_52_the_first_common_node_in_two_linked_lists_s1/sfo_52_the_first_common_node_in_two_linked_lists_s1.java
similarity index 100%
rename from java/sfo_52_the_first_common_node_in_two_linked_lists_s1/sfo_52_the_first_common_node_in_two_linked_lists_s1.java
rename to sword_for_offer/codes/java/sfo_52_the_first_common_node_in_two_linked_lists_s1/sfo_52_the_first_common_node_in_two_linked_lists_s1.java
diff --git a/java/sfo_53i_find_a_number_in_a_sorted_array_s1/sfo_53i_find_a_number_in_a_sorted_array_s1.java b/sword_for_offer/codes/java/sfo_53i_find_a_number_in_a_sorted_array_s1/sfo_53i_find_a_number_in_a_sorted_array_s1.java
similarity index 100%
rename from java/sfo_53i_find_a_number_in_a_sorted_array_s1/sfo_53i_find_a_number_in_a_sorted_array_s1.java
rename to sword_for_offer/codes/java/sfo_53i_find_a_number_in_a_sorted_array_s1/sfo_53i_find_a_number_in_a_sorted_array_s1.java
diff --git a/java/sfo_53i_find_a_number_in_a_sorted_array_s2/sfo_53i_find_a_number_in_a_sorted_array_s2.java b/sword_for_offer/codes/java/sfo_53i_find_a_number_in_a_sorted_array_s2/sfo_53i_find_a_number_in_a_sorted_array_s2.java
similarity index 100%
rename from java/sfo_53i_find_a_number_in_a_sorted_array_s2/sfo_53i_find_a_number_in_a_sorted_array_s2.java
rename to sword_for_offer/codes/java/sfo_53i_find_a_number_in_a_sorted_array_s2/sfo_53i_find_a_number_in_a_sorted_array_s2.java
diff --git a/java/sfo_53ii_the_missing_number_from_0_to_n1_s1/sfo_53ii_the_missing_number_from_0_to_n1_s1.java b/sword_for_offer/codes/java/sfo_53ii_the_missing_number_from_0_to_n1_s1/sfo_53ii_the_missing_number_from_0_to_n1_s1.java
similarity index 100%
rename from java/sfo_53ii_the_missing_number_from_0_to_n1_s1/sfo_53ii_the_missing_number_from_0_to_n1_s1.java
rename to sword_for_offer/codes/java/sfo_53ii_the_missing_number_from_0_to_n1_s1/sfo_53ii_the_missing_number_from_0_to_n1_s1.java
diff --git a/java/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.java b/sword_for_offer/codes/java/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.java
similarity index 100%
rename from java/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.java
rename to sword_for_offer/codes/java/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.java
diff --git a/java/sfo_55i_depth_of_a_binary_tree_s1/sfo_55i_depth_of_a_binary_tree_s1.java b/sword_for_offer/codes/java/sfo_55i_depth_of_a_binary_tree_s1/sfo_55i_depth_of_a_binary_tree_s1.java
similarity index 100%
rename from java/sfo_55i_depth_of_a_binary_tree_s1/sfo_55i_depth_of_a_binary_tree_s1.java
rename to sword_for_offer/codes/java/sfo_55i_depth_of_a_binary_tree_s1/sfo_55i_depth_of_a_binary_tree_s1.java
diff --git a/java/sfo_55i_depth_of_a_binary_tree_s2/sfo_55i_depth_of_a_binary_tree_s2.java b/sword_for_offer/codes/java/sfo_55i_depth_of_a_binary_tree_s2/sfo_55i_depth_of_a_binary_tree_s2.java
similarity index 100%
rename from java/sfo_55i_depth_of_a_binary_tree_s2/sfo_55i_depth_of_a_binary_tree_s2.java
rename to sword_for_offer/codes/java/sfo_55i_depth_of_a_binary_tree_s2/sfo_55i_depth_of_a_binary_tree_s2.java
diff --git a/java/sfo_55ii_balanced_binary_tree_s1/sfo_55ii_balanced_binary_tree_s1.java b/sword_for_offer/codes/java/sfo_55ii_balanced_binary_tree_s1/sfo_55ii_balanced_binary_tree_s1.java
similarity index 100%
rename from java/sfo_55ii_balanced_binary_tree_s1/sfo_55ii_balanced_binary_tree_s1.java
rename to sword_for_offer/codes/java/sfo_55ii_balanced_binary_tree_s1/sfo_55ii_balanced_binary_tree_s1.java
diff --git a/java/sfo_55ii_balanced_binary_tree_s2/sfo_55ii_balanced_binary_tree_s2.java b/sword_for_offer/codes/java/sfo_55ii_balanced_binary_tree_s2/sfo_55ii_balanced_binary_tree_s2.java
similarity index 100%
rename from java/sfo_55ii_balanced_binary_tree_s2/sfo_55ii_balanced_binary_tree_s2.java
rename to sword_for_offer/codes/java/sfo_55ii_balanced_binary_tree_s2/sfo_55ii_balanced_binary_tree_s2.java
diff --git a/java/sfo_56i_single_number_i_s1/sfo_56i_single_number_i_s1.java b/sword_for_offer/codes/java/sfo_56i_single_number_i_s1/sfo_56i_single_number_i_s1.java
similarity index 100%
rename from java/sfo_56i_single_number_i_s1/sfo_56i_single_number_i_s1.java
rename to sword_for_offer/codes/java/sfo_56i_single_number_i_s1/sfo_56i_single_number_i_s1.java
diff --git a/java/sfo_56ii_single_number_ii_s1/sfo_56ii_single_number_ii_s1.java b/sword_for_offer/codes/java/sfo_56ii_single_number_ii_s1/sfo_56ii_single_number_ii_s1.java
similarity index 100%
rename from java/sfo_56ii_single_number_ii_s1/sfo_56ii_single_number_ii_s1.java
rename to sword_for_offer/codes/java/sfo_56ii_single_number_ii_s1/sfo_56ii_single_number_ii_s1.java
diff --git a/java/sfo_56ii_single_number_ii_s2/sfo_56ii_single_number_ii_s2.java b/sword_for_offer/codes/java/sfo_56ii_single_number_ii_s2/sfo_56ii_single_number_ii_s2.java
similarity index 100%
rename from java/sfo_56ii_single_number_ii_s2/sfo_56ii_single_number_ii_s2.java
rename to sword_for_offer/codes/java/sfo_56ii_single_number_ii_s2/sfo_56ii_single_number_ii_s2.java
diff --git a/java/sfo_57_two_numbers_with_sum_s_s1/sfo_57_two_numbers_with_sum_s_s1.java b/sword_for_offer/codes/java/sfo_57_two_numbers_with_sum_s_s1/sfo_57_two_numbers_with_sum_s_s1.java
similarity index 100%
rename from java/sfo_57_two_numbers_with_sum_s_s1/sfo_57_two_numbers_with_sum_s_s1.java
rename to sword_for_offer/codes/java/sfo_57_two_numbers_with_sum_s_s1/sfo_57_two_numbers_with_sum_s_s1.java
diff --git a/java/sfo_57ii_consecutive_numbers_with_sum_s_s1/sfo_57ii_consecutive_numbers_with_sum_s_s1.java b/sword_for_offer/codes/java/sfo_57ii_consecutive_numbers_with_sum_s_s1/sfo_57ii_consecutive_numbers_with_sum_s_s1.java
similarity index 100%
rename from java/sfo_57ii_consecutive_numbers_with_sum_s_s1/sfo_57ii_consecutive_numbers_with_sum_s_s1.java
rename to sword_for_offer/codes/java/sfo_57ii_consecutive_numbers_with_sum_s_s1/sfo_57ii_consecutive_numbers_with_sum_s_s1.java
diff --git a/java/sfo_57ii_consecutive_numbers_with_sum_s_s2/sfo_57ii_consecutive_numbers_with_sum_s_s2.java b/sword_for_offer/codes/java/sfo_57ii_consecutive_numbers_with_sum_s_s2/sfo_57ii_consecutive_numbers_with_sum_s_s2.java
similarity index 100%
rename from java/sfo_57ii_consecutive_numbers_with_sum_s_s2/sfo_57ii_consecutive_numbers_with_sum_s_s2.java
rename to sword_for_offer/codes/java/sfo_57ii_consecutive_numbers_with_sum_s_s2/sfo_57ii_consecutive_numbers_with_sum_s_s2.java
diff --git a/java/sfo_58i_reverse_order_of_words_s1/sfo_58i_reverse_order_of_words_s1.java b/sword_for_offer/codes/java/sfo_58i_reverse_order_of_words_s1/sfo_58i_reverse_order_of_words_s1.java
similarity index 100%
rename from java/sfo_58i_reverse_order_of_words_s1/sfo_58i_reverse_order_of_words_s1.java
rename to sword_for_offer/codes/java/sfo_58i_reverse_order_of_words_s1/sfo_58i_reverse_order_of_words_s1.java
diff --git a/java/sfo_58i_reverse_order_of_words_s2/sfo_58i_reverse_order_of_words_s2.java b/sword_for_offer/codes/java/sfo_58i_reverse_order_of_words_s2/sfo_58i_reverse_order_of_words_s2.java
similarity index 100%
rename from java/sfo_58i_reverse_order_of_words_s2/sfo_58i_reverse_order_of_words_s2.java
rename to sword_for_offer/codes/java/sfo_58i_reverse_order_of_words_s2/sfo_58i_reverse_order_of_words_s2.java
diff --git a/java/sfo_58ii_left_rotation_of_a_string_s1/sfo_58ii_left_rotation_of_a_string_s1.java b/sword_for_offer/codes/java/sfo_58ii_left_rotation_of_a_string_s1/sfo_58ii_left_rotation_of_a_string_s1.java
similarity index 100%
rename from java/sfo_58ii_left_rotation_of_a_string_s1/sfo_58ii_left_rotation_of_a_string_s1.java
rename to sword_for_offer/codes/java/sfo_58ii_left_rotation_of_a_string_s1/sfo_58ii_left_rotation_of_a_string_s1.java
diff --git a/java/sfo_58ii_left_rotation_of_a_string_s2/sfo_58ii_left_rotation_of_a_string_s2.java b/sword_for_offer/codes/java/sfo_58ii_left_rotation_of_a_string_s2/sfo_58ii_left_rotation_of_a_string_s2.java
similarity index 100%
rename from java/sfo_58ii_left_rotation_of_a_string_s2/sfo_58ii_left_rotation_of_a_string_s2.java
rename to sword_for_offer/codes/java/sfo_58ii_left_rotation_of_a_string_s2/sfo_58ii_left_rotation_of_a_string_s2.java
diff --git a/java/sfo_58ii_left_rotation_of_a_string_s3/sfo_58ii_left_rotation_of_a_string_s3.java b/sword_for_offer/codes/java/sfo_58ii_left_rotation_of_a_string_s3/sfo_58ii_left_rotation_of_a_string_s3.java
similarity index 100%
rename from java/sfo_58ii_left_rotation_of_a_string_s3/sfo_58ii_left_rotation_of_a_string_s3.java
rename to sword_for_offer/codes/java/sfo_58ii_left_rotation_of_a_string_s3/sfo_58ii_left_rotation_of_a_string_s3.java
diff --git a/java/sfo_58ii_left_rotation_of_a_string_s4/sfo_58ii_left_rotation_of_a_string_s4.java b/sword_for_offer/codes/java/sfo_58ii_left_rotation_of_a_string_s4/sfo_58ii_left_rotation_of_a_string_s4.java
similarity index 100%
rename from java/sfo_58ii_left_rotation_of_a_string_s4/sfo_58ii_left_rotation_of_a_string_s4.java
rename to sword_for_offer/codes/java/sfo_58ii_left_rotation_of_a_string_s4/sfo_58ii_left_rotation_of_a_string_s4.java
diff --git a/java/sfo_58ii_left_rotation_of_a_string_s5/sfo_58ii_left_rotation_of_a_string_s5.java b/sword_for_offer/codes/java/sfo_58ii_left_rotation_of_a_string_s5/sfo_58ii_left_rotation_of_a_string_s5.java
similarity index 100%
rename from java/sfo_58ii_left_rotation_of_a_string_s5/sfo_58ii_left_rotation_of_a_string_s5.java
rename to sword_for_offer/codes/java/sfo_58ii_left_rotation_of_a_string_s5/sfo_58ii_left_rotation_of_a_string_s5.java
diff --git a/java/sfo_59i_sliding_window_maximum_s1/sfo_59i_sliding_window_maximum_s1.java b/sword_for_offer/codes/java/sfo_59i_sliding_window_maximum_s1/sfo_59i_sliding_window_maximum_s1.java
similarity index 100%
rename from java/sfo_59i_sliding_window_maximum_s1/sfo_59i_sliding_window_maximum_s1.java
rename to sword_for_offer/codes/java/sfo_59i_sliding_window_maximum_s1/sfo_59i_sliding_window_maximum_s1.java
diff --git a/java/sfo_59i_sliding_window_maximum_s2/sfo_59i_sliding_window_maximum_s2.java b/sword_for_offer/codes/java/sfo_59i_sliding_window_maximum_s2/sfo_59i_sliding_window_maximum_s2.java
similarity index 100%
rename from java/sfo_59i_sliding_window_maximum_s2/sfo_59i_sliding_window_maximum_s2.java
rename to sword_for_offer/codes/java/sfo_59i_sliding_window_maximum_s2/sfo_59i_sliding_window_maximum_s2.java
diff --git a/java/sfo_59ii_max_queue_s1/sfo_59ii_max_queue_s1.java b/sword_for_offer/codes/java/sfo_59ii_max_queue_s1/sfo_59ii_max_queue_s1.java
similarity index 100%
rename from java/sfo_59ii_max_queue_s1/sfo_59ii_max_queue_s1.java
rename to sword_for_offer/codes/java/sfo_59ii_max_queue_s1/sfo_59ii_max_queue_s1.java
diff --git a/java/sfo_60_probabilities_for_rolling_n_dices_s1/sfo_60_probabilities_for_rolling_n_dices_s1.java b/sword_for_offer/codes/java/sfo_60_probabilities_for_rolling_n_dices_s1/sfo_60_probabilities_for_rolling_n_dices_s1.java
similarity index 100%
rename from java/sfo_60_probabilities_for_rolling_n_dices_s1/sfo_60_probabilities_for_rolling_n_dices_s1.java
rename to sword_for_offer/codes/java/sfo_60_probabilities_for_rolling_n_dices_s1/sfo_60_probabilities_for_rolling_n_dices_s1.java
diff --git a/java/sfo_61_straight_in_poker_s1/sfo_61_straight_in_poker_s1.java b/sword_for_offer/codes/java/sfo_61_straight_in_poker_s1/sfo_61_straight_in_poker_s1.java
similarity index 100%
rename from java/sfo_61_straight_in_poker_s1/sfo_61_straight_in_poker_s1.java
rename to sword_for_offer/codes/java/sfo_61_straight_in_poker_s1/sfo_61_straight_in_poker_s1.java
diff --git a/java/sfo_61_straight_in_poker_s2/sfo_61_straight_in_poker_s2.java b/sword_for_offer/codes/java/sfo_61_straight_in_poker_s2/sfo_61_straight_in_poker_s2.java
similarity index 100%
rename from java/sfo_61_straight_in_poker_s2/sfo_61_straight_in_poker_s2.java
rename to sword_for_offer/codes/java/sfo_61_straight_in_poker_s2/sfo_61_straight_in_poker_s2.java
diff --git a/java/sfo_62_josephus_problem_s1/sfo_62_josephus_problem_s1.java b/sword_for_offer/codes/java/sfo_62_josephus_problem_s1/sfo_62_josephus_problem_s1.java
similarity index 100%
rename from java/sfo_62_josephus_problem_s1/sfo_62_josephus_problem_s1.java
rename to sword_for_offer/codes/java/sfo_62_josephus_problem_s1/sfo_62_josephus_problem_s1.java
diff --git a/java/sfo_63_the_maximum_profit_of_stocks_s1/sfo_63_the_maximum_profit_of_stocks_s1.java b/sword_for_offer/codes/java/sfo_63_the_maximum_profit_of_stocks_s1/sfo_63_the_maximum_profit_of_stocks_s1.java
similarity index 100%
rename from java/sfo_63_the_maximum_profit_of_stocks_s1/sfo_63_the_maximum_profit_of_stocks_s1.java
rename to sword_for_offer/codes/java/sfo_63_the_maximum_profit_of_stocks_s1/sfo_63_the_maximum_profit_of_stocks_s1.java
diff --git a/java/sfo_64_solve_1_2___n_s1/sfo_64_solve_1_2___n_s1.java b/sword_for_offer/codes/java/sfo_64_solve_1_2___n_s1/sfo_64_solve_1_2___n_s1.java
similarity index 100%
rename from java/sfo_64_solve_1_2___n_s1/sfo_64_solve_1_2___n_s1.java
rename to sword_for_offer/codes/java/sfo_64_solve_1_2___n_s1/sfo_64_solve_1_2___n_s1.java
diff --git a/java/sfo_64_solve_1_2___n_s2/sfo_64_solve_1_2___n_s2.java b/sword_for_offer/codes/java/sfo_64_solve_1_2___n_s2/sfo_64_solve_1_2___n_s2.java
similarity index 100%
rename from java/sfo_64_solve_1_2___n_s2/sfo_64_solve_1_2___n_s2.java
rename to sword_for_offer/codes/java/sfo_64_solve_1_2___n_s2/sfo_64_solve_1_2___n_s2.java
diff --git a/java/sfo_65_implement_addition_operation_without_arithmetic_operators_s1/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.java b/sword_for_offer/codes/java/sfo_65_implement_addition_operation_without_arithmetic_operators_s1/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.java
similarity index 100%
rename from java/sfo_65_implement_addition_operation_without_arithmetic_operators_s1/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.java
rename to sword_for_offer/codes/java/sfo_65_implement_addition_operation_without_arithmetic_operators_s1/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.java
diff --git a/java/sfo_66_a_product_array_puzzle_s1/sfo_66_a_product_array_puzzle_s1.java b/sword_for_offer/codes/java/sfo_66_a_product_array_puzzle_s1/sfo_66_a_product_array_puzzle_s1.java
similarity index 100%
rename from java/sfo_66_a_product_array_puzzle_s1/sfo_66_a_product_array_puzzle_s1.java
rename to sword_for_offer/codes/java/sfo_66_a_product_array_puzzle_s1/sfo_66_a_product_array_puzzle_s1.java
diff --git a/java/sfo_67_convert_string_to_int_s1/sfo_67_convert_string_to_int_s1.java b/sword_for_offer/codes/java/sfo_67_convert_string_to_int_s1/sfo_67_convert_string_to_int_s1.java
similarity index 100%
rename from java/sfo_67_convert_string_to_int_s1/sfo_67_convert_string_to_int_s1.java
rename to sword_for_offer/codes/java/sfo_67_convert_string_to_int_s1/sfo_67_convert_string_to_int_s1.java
diff --git a/java/sfo_67_convert_string_to_int_s2/sfo_67_convert_string_to_int_s2.java b/sword_for_offer/codes/java/sfo_67_convert_string_to_int_s2/sfo_67_convert_string_to_int_s2.java
similarity index 100%
rename from java/sfo_67_convert_string_to_int_s2/sfo_67_convert_string_to_int_s2.java
rename to sword_for_offer/codes/java/sfo_67_convert_string_to_int_s2/sfo_67_convert_string_to_int_s2.java
diff --git a/java/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.java b/sword_for_offer/codes/java/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.java
similarity index 100%
rename from java/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.java
rename to sword_for_offer/codes/java/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.java
diff --git a/java/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.java b/sword_for_offer/codes/java/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.java
similarity index 100%
rename from java/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.java
rename to sword_for_offer/codes/java/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.java
diff --git a/java/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.java b/sword_for_offer/codes/java/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.java
similarity index 100%
rename from java/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.java
rename to sword_for_offer/codes/java/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.java
diff --git a/java/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.java b/sword_for_offer/codes/java/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.java
similarity index 100%
rename from java/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.java
rename to sword_for_offer/codes/java/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.java
diff --git a/java/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.java b/sword_for_offer/codes/java/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.java
similarity index 100%
rename from java/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.java
rename to sword_for_offer/codes/java/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.java
diff --git a/python/include/__init__.py b/sword_for_offer/codes/python/include/__init__.py
similarity index 100%
rename from python/include/__init__.py
rename to sword_for_offer/codes/python/include/__init__.py
diff --git a/python/include/binary_tree.py b/sword_for_offer/codes/python/include/binary_tree.py
similarity index 100%
rename from python/include/binary_tree.py
rename to sword_for_offer/codes/python/include/binary_tree.py
diff --git a/python/include/linked_list.py b/sword_for_offer/codes/python/include/linked_list.py
similarity index 100%
rename from python/include/linked_list.py
rename to sword_for_offer/codes/python/include/linked_list.py
diff --git a/python/include/print_util.py b/sword_for_offer/codes/python/include/print_util.py
similarity index 100%
rename from python/include/print_util.py
rename to sword_for_offer/codes/python/include/print_util.py
diff --git a/python/sfo_03_find_duplicate_numbers_in_an_array_s1.py b/sword_for_offer/codes/python/sfo_03_find_duplicate_numbers_in_an_array_s1.py
similarity index 100%
rename from python/sfo_03_find_duplicate_numbers_in_an_array_s1.py
rename to sword_for_offer/codes/python/sfo_03_find_duplicate_numbers_in_an_array_s1.py
diff --git a/python/sfo_03_find_duplicate_numbers_in_an_array_s2.py b/sword_for_offer/codes/python/sfo_03_find_duplicate_numbers_in_an_array_s2.py
similarity index 100%
rename from python/sfo_03_find_duplicate_numbers_in_an_array_s2.py
rename to sword_for_offer/codes/python/sfo_03_find_duplicate_numbers_in_an_array_s2.py
diff --git a/python/sfo_04_find_a_number_in_2d_matrix_s1.py b/sword_for_offer/codes/python/sfo_04_find_a_number_in_2d_matrix_s1.py
similarity index 100%
rename from python/sfo_04_find_a_number_in_2d_matrix_s1.py
rename to sword_for_offer/codes/python/sfo_04_find_a_number_in_2d_matrix_s1.py
diff --git a/python/sfo_05_replace_spaces_s1.py b/sword_for_offer/codes/python/sfo_05_replace_spaces_s1.py
similarity index 100%
rename from python/sfo_05_replace_spaces_s1.py
rename to sword_for_offer/codes/python/sfo_05_replace_spaces_s1.py
diff --git a/python/sfo_06_print_a_linked_list_in_reverse_order_s1.py b/sword_for_offer/codes/python/sfo_06_print_a_linked_list_in_reverse_order_s1.py
similarity index 100%
rename from python/sfo_06_print_a_linked_list_in_reverse_order_s1.py
rename to sword_for_offer/codes/python/sfo_06_print_a_linked_list_in_reverse_order_s1.py
diff --git a/python/sfo_06_print_a_linked_list_in_reverse_order_s2.py b/sword_for_offer/codes/python/sfo_06_print_a_linked_list_in_reverse_order_s2.py
similarity index 100%
rename from python/sfo_06_print_a_linked_list_in_reverse_order_s2.py
rename to sword_for_offer/codes/python/sfo_06_print_a_linked_list_in_reverse_order_s2.py
diff --git a/python/sfo_07_reconstruct_binary_tree_s1.py b/sword_for_offer/codes/python/sfo_07_reconstruct_binary_tree_s1.py
similarity index 100%
rename from python/sfo_07_reconstruct_binary_tree_s1.py
rename to sword_for_offer/codes/python/sfo_07_reconstruct_binary_tree_s1.py
diff --git a/python/sfo_09_implement_a_queue_using_two_stacks_s1.py b/sword_for_offer/codes/python/sfo_09_implement_a_queue_using_two_stacks_s1.py
similarity index 100%
rename from python/sfo_09_implement_a_queue_using_two_stacks_s1.py
rename to sword_for_offer/codes/python/sfo_09_implement_a_queue_using_two_stacks_s1.py
diff --git a/python/sfo_10i_fibonacci_numbers_s1.py b/sword_for_offer/codes/python/sfo_10i_fibonacci_numbers_s1.py
similarity index 100%
rename from python/sfo_10i_fibonacci_numbers_s1.py
rename to sword_for_offer/codes/python/sfo_10i_fibonacci_numbers_s1.py
diff --git a/python/sfo_10i_fibonacci_numbers_s2.py b/sword_for_offer/codes/python/sfo_10i_fibonacci_numbers_s2.py
similarity index 100%
rename from python/sfo_10i_fibonacci_numbers_s2.py
rename to sword_for_offer/codes/python/sfo_10i_fibonacci_numbers_s2.py
diff --git a/python/sfo_10ii_frog_jump_s1.py b/sword_for_offer/codes/python/sfo_10ii_frog_jump_s1.py
similarity index 100%
rename from python/sfo_10ii_frog_jump_s1.py
rename to sword_for_offer/codes/python/sfo_10ii_frog_jump_s1.py
diff --git a/python/sfo_10ii_frog_jump_s2.py b/sword_for_offer/codes/python/sfo_10ii_frog_jump_s2.py
similarity index 100%
rename from python/sfo_10ii_frog_jump_s2.py
rename to sword_for_offer/codes/python/sfo_10ii_frog_jump_s2.py
diff --git a/python/sfo_11_find_minimum_in_rotated_sorted_array_s1.py b/sword_for_offer/codes/python/sfo_11_find_minimum_in_rotated_sorted_array_s1.py
similarity index 100%
rename from python/sfo_11_find_minimum_in_rotated_sorted_array_s1.py
rename to sword_for_offer/codes/python/sfo_11_find_minimum_in_rotated_sorted_array_s1.py
diff --git a/python/sfo_11_find_minimum_in_rotated_sorted_array_s2.py b/sword_for_offer/codes/python/sfo_11_find_minimum_in_rotated_sorted_array_s2.py
similarity index 100%
rename from python/sfo_11_find_minimum_in_rotated_sorted_array_s2.py
rename to sword_for_offer/codes/python/sfo_11_find_minimum_in_rotated_sorted_array_s2.py
diff --git a/python/sfo_12_word_search_s1.py b/sword_for_offer/codes/python/sfo_12_word_search_s1.py
similarity index 100%
rename from python/sfo_12_word_search_s1.py
rename to sword_for_offer/codes/python/sfo_12_word_search_s1.py
diff --git a/python/sfo_13_range_of_motion_of_a_robot_s1.py b/sword_for_offer/codes/python/sfo_13_range_of_motion_of_a_robot_s1.py
similarity index 100%
rename from python/sfo_13_range_of_motion_of_a_robot_s1.py
rename to sword_for_offer/codes/python/sfo_13_range_of_motion_of_a_robot_s1.py
diff --git a/python/sfo_13_range_of_motion_of_a_robot_s2.py b/sword_for_offer/codes/python/sfo_13_range_of_motion_of_a_robot_s2.py
similarity index 100%
rename from python/sfo_13_range_of_motion_of_a_robot_s2.py
rename to sword_for_offer/codes/python/sfo_13_range_of_motion_of_a_robot_s2.py
diff --git a/python/sfo_14i_cut_the_rope_i_s1.py b/sword_for_offer/codes/python/sfo_14i_cut_the_rope_i_s1.py
similarity index 100%
rename from python/sfo_14i_cut_the_rope_i_s1.py
rename to sword_for_offer/codes/python/sfo_14i_cut_the_rope_i_s1.py
diff --git a/python/sfo_14ii_cut_the_rope_ii_s1.py b/sword_for_offer/codes/python/sfo_14ii_cut_the_rope_ii_s1.py
similarity index 100%
rename from python/sfo_14ii_cut_the_rope_ii_s1.py
rename to sword_for_offer/codes/python/sfo_14ii_cut_the_rope_ii_s1.py
diff --git a/python/sfo_14ii_cut_the_rope_ii_s2.py b/sword_for_offer/codes/python/sfo_14ii_cut_the_rope_ii_s2.py
similarity index 100%
rename from python/sfo_14ii_cut_the_rope_ii_s2.py
rename to sword_for_offer/codes/python/sfo_14ii_cut_the_rope_ii_s2.py
diff --git a/python/sfo_15_number_of_1_bits_s1.py b/sword_for_offer/codes/python/sfo_15_number_of_1_bits_s1.py
similarity index 100%
rename from python/sfo_15_number_of_1_bits_s1.py
rename to sword_for_offer/codes/python/sfo_15_number_of_1_bits_s1.py
diff --git a/python/sfo_15_number_of_1_bits_s2.py b/sword_for_offer/codes/python/sfo_15_number_of_1_bits_s2.py
similarity index 100%
rename from python/sfo_15_number_of_1_bits_s2.py
rename to sword_for_offer/codes/python/sfo_15_number_of_1_bits_s2.py
diff --git a/python/sfo_16_powers_of_integers_s1.py b/sword_for_offer/codes/python/sfo_16_powers_of_integers_s1.py
similarity index 100%
rename from python/sfo_16_powers_of_integers_s1.py
rename to sword_for_offer/codes/python/sfo_16_powers_of_integers_s1.py
diff --git a/python/sfo_17_print_from_1_to_the_largest_n_digits_s1.py b/sword_for_offer/codes/python/sfo_17_print_from_1_to_the_largest_n_digits_s1.py
similarity index 100%
rename from python/sfo_17_print_from_1_to_the_largest_n_digits_s1.py
rename to sword_for_offer/codes/python/sfo_17_print_from_1_to_the_largest_n_digits_s1.py
diff --git a/python/sfo_17_print_from_1_to_the_largest_n_digits_s2.py b/sword_for_offer/codes/python/sfo_17_print_from_1_to_the_largest_n_digits_s2.py
similarity index 100%
rename from python/sfo_17_print_from_1_to_the_largest_n_digits_s2.py
rename to sword_for_offer/codes/python/sfo_17_print_from_1_to_the_largest_n_digits_s2.py
diff --git a/python/sfo_17_print_from_1_to_the_largest_n_digits_s3.py b/sword_for_offer/codes/python/sfo_17_print_from_1_to_the_largest_n_digits_s3.py
similarity index 100%
rename from python/sfo_17_print_from_1_to_the_largest_n_digits_s3.py
rename to sword_for_offer/codes/python/sfo_17_print_from_1_to_the_largest_n_digits_s3.py
diff --git a/python/sfo_17_print_from_1_to_the_largest_n_digits_s4.py b/sword_for_offer/codes/python/sfo_17_print_from_1_to_the_largest_n_digits_s4.py
similarity index 100%
rename from python/sfo_17_print_from_1_to_the_largest_n_digits_s4.py
rename to sword_for_offer/codes/python/sfo_17_print_from_1_to_the_largest_n_digits_s4.py
diff --git a/python/sfo_18_delete_a_node_from_a_linked_list_s1.py b/sword_for_offer/codes/python/sfo_18_delete_a_node_from_a_linked_list_s1.py
similarity index 100%
rename from python/sfo_18_delete_a_node_from_a_linked_list_s1.py
rename to sword_for_offer/codes/python/sfo_18_delete_a_node_from_a_linked_list_s1.py
diff --git a/python/sfo_19_regular_expression_matching_s1.py b/sword_for_offer/codes/python/sfo_19_regular_expression_matching_s1.py
similarity index 100%
rename from python/sfo_19_regular_expression_matching_s1.py
rename to sword_for_offer/codes/python/sfo_19_regular_expression_matching_s1.py
diff --git a/python/sfo_19_regular_expression_matching_s2.py b/sword_for_offer/codes/python/sfo_19_regular_expression_matching_s2.py
similarity index 100%
rename from python/sfo_19_regular_expression_matching_s2.py
rename to sword_for_offer/codes/python/sfo_19_regular_expression_matching_s2.py
diff --git a/python/sfo_20_a_string_representing_a_numeric_value_s1.py b/sword_for_offer/codes/python/sfo_20_a_string_representing_a_numeric_value_s1.py
similarity index 100%
rename from python/sfo_20_a_string_representing_a_numeric_value_s1.py
rename to sword_for_offer/codes/python/sfo_20_a_string_representing_a_numeric_value_s1.py
diff --git a/python/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.py b/sword_for_offer/codes/python/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.py
similarity index 100%
rename from python/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.py
rename to sword_for_offer/codes/python/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.py
diff --git a/python/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.py b/sword_for_offer/codes/python/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.py
similarity index 100%
rename from python/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.py
rename to sword_for_offer/codes/python/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.py
diff --git a/python/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.py b/sword_for_offer/codes/python/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.py
similarity index 100%
rename from python/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.py
rename to sword_for_offer/codes/python/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.py
diff --git a/python/sfo_24_reverse_a_linked_list_s1.py b/sword_for_offer/codes/python/sfo_24_reverse_a_linked_list_s1.py
similarity index 100%
rename from python/sfo_24_reverse_a_linked_list_s1.py
rename to sword_for_offer/codes/python/sfo_24_reverse_a_linked_list_s1.py
diff --git a/python/sfo_24_reverse_a_linked_list_s2.py b/sword_for_offer/codes/python/sfo_24_reverse_a_linked_list_s2.py
similarity index 100%
rename from python/sfo_24_reverse_a_linked_list_s2.py
rename to sword_for_offer/codes/python/sfo_24_reverse_a_linked_list_s2.py
diff --git a/python/sfo_24_reverse_a_linked_list_s3.py b/sword_for_offer/codes/python/sfo_24_reverse_a_linked_list_s3.py
similarity index 100%
rename from python/sfo_24_reverse_a_linked_list_s3.py
rename to sword_for_offer/codes/python/sfo_24_reverse_a_linked_list_s3.py
diff --git a/python/sfo_25_combine_two_sorted_linked_lists_s1.py b/sword_for_offer/codes/python/sfo_25_combine_two_sorted_linked_lists_s1.py
similarity index 100%
rename from python/sfo_25_combine_two_sorted_linked_lists_s1.py
rename to sword_for_offer/codes/python/sfo_25_combine_two_sorted_linked_lists_s1.py
diff --git a/python/sfo_26_substructure_of_a_binary_tree_s1.py b/sword_for_offer/codes/python/sfo_26_substructure_of_a_binary_tree_s1.py
similarity index 100%
rename from python/sfo_26_substructure_of_a_binary_tree_s1.py
rename to sword_for_offer/codes/python/sfo_26_substructure_of_a_binary_tree_s1.py
diff --git a/python/sfo_27_mirror_of_a_binary_tree_s1.py b/sword_for_offer/codes/python/sfo_27_mirror_of_a_binary_tree_s1.py
similarity index 100%
rename from python/sfo_27_mirror_of_a_binary_tree_s1.py
rename to sword_for_offer/codes/python/sfo_27_mirror_of_a_binary_tree_s1.py
diff --git a/python/sfo_27_mirror_of_a_binary_tree_s2.py b/sword_for_offer/codes/python/sfo_27_mirror_of_a_binary_tree_s2.py
similarity index 100%
rename from python/sfo_27_mirror_of_a_binary_tree_s2.py
rename to sword_for_offer/codes/python/sfo_27_mirror_of_a_binary_tree_s2.py
diff --git a/python/sfo_27_mirror_of_a_binary_tree_s3.py b/sword_for_offer/codes/python/sfo_27_mirror_of_a_binary_tree_s3.py
similarity index 100%
rename from python/sfo_27_mirror_of_a_binary_tree_s3.py
rename to sword_for_offer/codes/python/sfo_27_mirror_of_a_binary_tree_s3.py
diff --git a/python/sfo_28_symmetric_binary_tree_s1.py b/sword_for_offer/codes/python/sfo_28_symmetric_binary_tree_s1.py
similarity index 100%
rename from python/sfo_28_symmetric_binary_tree_s1.py
rename to sword_for_offer/codes/python/sfo_28_symmetric_binary_tree_s1.py
diff --git a/python/sfo_29_print_a_given_matrix_in_spiral_form_s1.py b/sword_for_offer/codes/python/sfo_29_print_a_given_matrix_in_spiral_form_s1.py
similarity index 100%
rename from python/sfo_29_print_a_given_matrix_in_spiral_form_s1.py
rename to sword_for_offer/codes/python/sfo_29_print_a_given_matrix_in_spiral_form_s1.py
diff --git a/python/sfo_30_min_stack_s1.py b/sword_for_offer/codes/python/sfo_30_min_stack_s1.py
similarity index 100%
rename from python/sfo_30_min_stack_s1.py
rename to sword_for_offer/codes/python/sfo_30_min_stack_s1.py
diff --git a/python/sfo_31_validate_stack_sequences_s1.py b/sword_for_offer/codes/python/sfo_31_validate_stack_sequences_s1.py
similarity index 100%
rename from python/sfo_31_validate_stack_sequences_s1.py
rename to sword_for_offer/codes/python/sfo_31_validate_stack_sequences_s1.py
diff --git a/python/sfo_32i_print_a_binary_tree_topbottom_i_s1.py b/sword_for_offer/codes/python/sfo_32i_print_a_binary_tree_topbottom_i_s1.py
similarity index 100%
rename from python/sfo_32i_print_a_binary_tree_topbottom_i_s1.py
rename to sword_for_offer/codes/python/sfo_32i_print_a_binary_tree_topbottom_i_s1.py
diff --git a/python/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.py b/sword_for_offer/codes/python/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.py
similarity index 100%
rename from python/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.py
rename to sword_for_offer/codes/python/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.py
diff --git a/python/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.py b/sword_for_offer/codes/python/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.py
similarity index 100%
rename from python/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.py
rename to sword_for_offer/codes/python/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.py
diff --git a/python/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.py b/sword_for_offer/codes/python/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.py
similarity index 100%
rename from python/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.py
rename to sword_for_offer/codes/python/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.py
diff --git a/python/sfo_32iii_print_a_binary_tree_topbottom_iii_s3.py b/sword_for_offer/codes/python/sfo_32iii_print_a_binary_tree_topbottom_iii_s3.py
similarity index 100%
rename from python/sfo_32iii_print_a_binary_tree_topbottom_iii_s3.py
rename to sword_for_offer/codes/python/sfo_32iii_print_a_binary_tree_topbottom_iii_s3.py
diff --git a/python/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.py b/sword_for_offer/codes/python/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.py
similarity index 100%
rename from python/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.py
rename to sword_for_offer/codes/python/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.py
diff --git a/python/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.py b/sword_for_offer/codes/python/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.py
similarity index 100%
rename from python/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.py
rename to sword_for_offer/codes/python/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.py
diff --git a/python/sfo_34_all_xsum_paths_in_a_binary_tree_s1.py b/sword_for_offer/codes/python/sfo_34_all_xsum_paths_in_a_binary_tree_s1.py
similarity index 100%
rename from python/sfo_34_all_xsum_paths_in_a_binary_tree_s1.py
rename to sword_for_offer/codes/python/sfo_34_all_xsum_paths_in_a_binary_tree_s1.py
diff --git a/python/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.py b/sword_for_offer/codes/python/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.py
similarity index 100%
rename from python/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.py
rename to sword_for_offer/codes/python/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.py
diff --git a/python/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.py b/sword_for_offer/codes/python/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.py
similarity index 100%
rename from python/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.py
rename to sword_for_offer/codes/python/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.py
diff --git a/python/sfo_36_binary_search_tree_and_doubly_linked_list_s1.py b/sword_for_offer/codes/python/sfo_36_binary_search_tree_and_doubly_linked_list_s1.py
similarity index 100%
rename from python/sfo_36_binary_search_tree_and_doubly_linked_list_s1.py
rename to sword_for_offer/codes/python/sfo_36_binary_search_tree_and_doubly_linked_list_s1.py
diff --git a/python/sfo_37_serialize_and_deserialize_a_binary_tree_s1.py b/sword_for_offer/codes/python/sfo_37_serialize_and_deserialize_a_binary_tree_s1.py
similarity index 100%
rename from python/sfo_37_serialize_and_deserialize_a_binary_tree_s1.py
rename to sword_for_offer/codes/python/sfo_37_serialize_and_deserialize_a_binary_tree_s1.py
diff --git a/python/sfo_38_all_permutations_of_a_string_s1.py b/sword_for_offer/codes/python/sfo_38_all_permutations_of_a_string_s1.py
similarity index 100%
rename from python/sfo_38_all_permutations_of_a_string_s1.py
rename to sword_for_offer/codes/python/sfo_38_all_permutations_of_a_string_s1.py
diff --git a/python/sfo_39_the_majority_element_in_an_array_s1.py b/sword_for_offer/codes/python/sfo_39_the_majority_element_in_an_array_s1.py
similarity index 100%
rename from python/sfo_39_the_majority_element_in_an_array_s1.py
rename to sword_for_offer/codes/python/sfo_39_the_majority_element_in_an_array_s1.py
diff --git a/python/sfo_39_the_majority_element_in_an_array_s2.py b/sword_for_offer/codes/python/sfo_39_the_majority_element_in_an_array_s2.py
similarity index 100%
rename from python/sfo_39_the_majority_element_in_an_array_s2.py
rename to sword_for_offer/codes/python/sfo_39_the_majority_element_in_an_array_s2.py
diff --git a/python/sfo_40_the_smallest_k_numbers_s1.py b/sword_for_offer/codes/python/sfo_40_the_smallest_k_numbers_s1.py
similarity index 100%
rename from python/sfo_40_the_smallest_k_numbers_s1.py
rename to sword_for_offer/codes/python/sfo_40_the_smallest_k_numbers_s1.py
diff --git a/python/sfo_40_the_smallest_k_numbers_s2.py b/sword_for_offer/codes/python/sfo_40_the_smallest_k_numbers_s2.py
similarity index 100%
rename from python/sfo_40_the_smallest_k_numbers_s2.py
rename to sword_for_offer/codes/python/sfo_40_the_smallest_k_numbers_s2.py
diff --git a/python/sfo_41_find_median_from_data_stream_s1.py b/sword_for_offer/codes/python/sfo_41_find_median_from_data_stream_s1.py
similarity index 100%
rename from python/sfo_41_find_median_from_data_stream_s1.py
rename to sword_for_offer/codes/python/sfo_41_find_median_from_data_stream_s1.py
diff --git a/python/sfo_41_find_median_from_data_stream_s2.py b/sword_for_offer/codes/python/sfo_41_find_median_from_data_stream_s2.py
similarity index 100%
rename from python/sfo_41_find_median_from_data_stream_s2.py
rename to sword_for_offer/codes/python/sfo_41_find_median_from_data_stream_s2.py
diff --git a/python/sfo_42_largest_sum_contiguous_subarray_s1.py b/sword_for_offer/codes/python/sfo_42_largest_sum_contiguous_subarray_s1.py
similarity index 100%
rename from python/sfo_42_largest_sum_contiguous_subarray_s1.py
rename to sword_for_offer/codes/python/sfo_42_largest_sum_contiguous_subarray_s1.py
diff --git a/python/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.py b/sword_for_offer/codes/python/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.py
similarity index 100%
rename from python/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.py
rename to sword_for_offer/codes/python/sfo_43_total_number_of_1_in_integers_from_1_to_n_s1.py
diff --git a/python/sfo_44_nth_digit_s1.py b/sword_for_offer/codes/python/sfo_44_nth_digit_s1.py
similarity index 100%
rename from python/sfo_44_nth_digit_s1.py
rename to sword_for_offer/codes/python/sfo_44_nth_digit_s1.py
diff --git a/python/sfo_45_arrange_an_array_into_the_smallest_number_s1.py b/sword_for_offer/codes/python/sfo_45_arrange_an_array_into_the_smallest_number_s1.py
similarity index 100%
rename from python/sfo_45_arrange_an_array_into_the_smallest_number_s1.py
rename to sword_for_offer/codes/python/sfo_45_arrange_an_array_into_the_smallest_number_s1.py
diff --git a/python/sfo_45_arrange_an_array_into_the_smallest_number_s2.py b/sword_for_offer/codes/python/sfo_45_arrange_an_array_into_the_smallest_number_s2.py
similarity index 100%
rename from python/sfo_45_arrange_an_array_into_the_smallest_number_s2.py
rename to sword_for_offer/codes/python/sfo_45_arrange_an_array_into_the_smallest_number_s2.py
diff --git a/python/sfo_46_translate_numbers_into_strings_s1.py b/sword_for_offer/codes/python/sfo_46_translate_numbers_into_strings_s1.py
similarity index 100%
rename from python/sfo_46_translate_numbers_into_strings_s1.py
rename to sword_for_offer/codes/python/sfo_46_translate_numbers_into_strings_s1.py
diff --git a/python/sfo_46_translate_numbers_into_strings_s2.py b/sword_for_offer/codes/python/sfo_46_translate_numbers_into_strings_s2.py
similarity index 100%
rename from python/sfo_46_translate_numbers_into_strings_s2.py
rename to sword_for_offer/codes/python/sfo_46_translate_numbers_into_strings_s2.py
diff --git a/python/sfo_46_translate_numbers_into_strings_s3.py b/sword_for_offer/codes/python/sfo_46_translate_numbers_into_strings_s3.py
similarity index 100%
rename from python/sfo_46_translate_numbers_into_strings_s3.py
rename to sword_for_offer/codes/python/sfo_46_translate_numbers_into_strings_s3.py
diff --git a/python/sfo_46_translate_numbers_into_strings_s4.py b/sword_for_offer/codes/python/sfo_46_translate_numbers_into_strings_s4.py
similarity index 100%
rename from python/sfo_46_translate_numbers_into_strings_s4.py
rename to sword_for_offer/codes/python/sfo_46_translate_numbers_into_strings_s4.py
diff --git a/python/sfo_46_translate_numbers_into_strings_s5.py b/sword_for_offer/codes/python/sfo_46_translate_numbers_into_strings_s5.py
similarity index 100%
rename from python/sfo_46_translate_numbers_into_strings_s5.py
rename to sword_for_offer/codes/python/sfo_46_translate_numbers_into_strings_s5.py
diff --git a/python/sfo_47_the_maximum_value_of_gifts_s1.py b/sword_for_offer/codes/python/sfo_47_the_maximum_value_of_gifts_s1.py
similarity index 100%
rename from python/sfo_47_the_maximum_value_of_gifts_s1.py
rename to sword_for_offer/codes/python/sfo_47_the_maximum_value_of_gifts_s1.py
diff --git a/python/sfo_47_the_maximum_value_of_gifts_s2.py b/sword_for_offer/codes/python/sfo_47_the_maximum_value_of_gifts_s2.py
similarity index 100%
rename from python/sfo_47_the_maximum_value_of_gifts_s2.py
rename to sword_for_offer/codes/python/sfo_47_the_maximum_value_of_gifts_s2.py
diff --git a/python/sfo_48_the_longest_substring_without_repeated_characters_s1.py b/sword_for_offer/codes/python/sfo_48_the_longest_substring_without_repeated_characters_s1.py
similarity index 100%
rename from python/sfo_48_the_longest_substring_without_repeated_characters_s1.py
rename to sword_for_offer/codes/python/sfo_48_the_longest_substring_without_repeated_characters_s1.py
diff --git a/python/sfo_48_the_longest_substring_without_repeated_characters_s2.py b/sword_for_offer/codes/python/sfo_48_the_longest_substring_without_repeated_characters_s2.py
similarity index 100%
rename from python/sfo_48_the_longest_substring_without_repeated_characters_s2.py
rename to sword_for_offer/codes/python/sfo_48_the_longest_substring_without_repeated_characters_s2.py
diff --git a/python/sfo_48_the_longest_substring_without_repeated_characters_s3.py b/sword_for_offer/codes/python/sfo_48_the_longest_substring_without_repeated_characters_s3.py
similarity index 100%
rename from python/sfo_48_the_longest_substring_without_repeated_characters_s3.py
rename to sword_for_offer/codes/python/sfo_48_the_longest_substring_without_repeated_characters_s3.py
diff --git a/python/sfo_49_ugly_numbers_s1.py b/sword_for_offer/codes/python/sfo_49_ugly_numbers_s1.py
similarity index 100%
rename from python/sfo_49_ugly_numbers_s1.py
rename to sword_for_offer/codes/python/sfo_49_ugly_numbers_s1.py
diff --git a/python/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.py b/sword_for_offer/codes/python/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.py
similarity index 100%
rename from python/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.py
rename to sword_for_offer/codes/python/sfo_50_find_the_first_nonrepeating_character_in_a_string_s1.py
diff --git a/python/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.py b/sword_for_offer/codes/python/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.py
similarity index 100%
rename from python/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.py
rename to sword_for_offer/codes/python/sfo_50_find_the_first_nonrepeating_character_in_a_string_s2.py
diff --git a/python/sfo_50_find_the_first_nonrepeating_character_in_a_string_s3.py b/sword_for_offer/codes/python/sfo_50_find_the_first_nonrepeating_character_in_a_string_s3.py
similarity index 100%
rename from python/sfo_50_find_the_first_nonrepeating_character_in_a_string_s3.py
rename to sword_for_offer/codes/python/sfo_50_find_the_first_nonrepeating_character_in_a_string_s3.py
diff --git a/python/sfo_51_reversed_pairs_in_an_array_s1.py b/sword_for_offer/codes/python/sfo_51_reversed_pairs_in_an_array_s1.py
similarity index 100%
rename from python/sfo_51_reversed_pairs_in_an_array_s1.py
rename to sword_for_offer/codes/python/sfo_51_reversed_pairs_in_an_array_s1.py
diff --git a/python/sfo_52_the_first_common_node_in_two_linked_lists_s1.py b/sword_for_offer/codes/python/sfo_52_the_first_common_node_in_two_linked_lists_s1.py
similarity index 100%
rename from python/sfo_52_the_first_common_node_in_two_linked_lists_s1.py
rename to sword_for_offer/codes/python/sfo_52_the_first_common_node_in_two_linked_lists_s1.py
diff --git a/python/sfo_53i_find_a_number_in_a_sorted_array_s1.py b/sword_for_offer/codes/python/sfo_53i_find_a_number_in_a_sorted_array_s1.py
similarity index 100%
rename from python/sfo_53i_find_a_number_in_a_sorted_array_s1.py
rename to sword_for_offer/codes/python/sfo_53i_find_a_number_in_a_sorted_array_s1.py
diff --git a/python/sfo_53i_find_a_number_in_a_sorted_array_s2.py b/sword_for_offer/codes/python/sfo_53i_find_a_number_in_a_sorted_array_s2.py
similarity index 100%
rename from python/sfo_53i_find_a_number_in_a_sorted_array_s2.py
rename to sword_for_offer/codes/python/sfo_53i_find_a_number_in_a_sorted_array_s2.py
diff --git a/python/sfo_53ii_the_missing_number_from_0_to_n1_s1.py b/sword_for_offer/codes/python/sfo_53ii_the_missing_number_from_0_to_n1_s1.py
similarity index 100%
rename from python/sfo_53ii_the_missing_number_from_0_to_n1_s1.py
rename to sword_for_offer/codes/python/sfo_53ii_the_missing_number_from_0_to_n1_s1.py
diff --git a/python/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.py b/sword_for_offer/codes/python/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.py
similarity index 100%
rename from python/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.py
rename to sword_for_offer/codes/python/sfo_54_the_kth_largest_node_of_a_binary_search_tree_s1.py
diff --git a/python/sfo_55i_depth_of_a_binary_tree_s1.py b/sword_for_offer/codes/python/sfo_55i_depth_of_a_binary_tree_s1.py
similarity index 100%
rename from python/sfo_55i_depth_of_a_binary_tree_s1.py
rename to sword_for_offer/codes/python/sfo_55i_depth_of_a_binary_tree_s1.py
diff --git a/python/sfo_55i_depth_of_a_binary_tree_s2.py b/sword_for_offer/codes/python/sfo_55i_depth_of_a_binary_tree_s2.py
similarity index 100%
rename from python/sfo_55i_depth_of_a_binary_tree_s2.py
rename to sword_for_offer/codes/python/sfo_55i_depth_of_a_binary_tree_s2.py
diff --git a/python/sfo_55ii_balanced_binary_tree_s1.py b/sword_for_offer/codes/python/sfo_55ii_balanced_binary_tree_s1.py
similarity index 100%
rename from python/sfo_55ii_balanced_binary_tree_s1.py
rename to sword_for_offer/codes/python/sfo_55ii_balanced_binary_tree_s1.py
diff --git a/python/sfo_55ii_balanced_binary_tree_s2.py b/sword_for_offer/codes/python/sfo_55ii_balanced_binary_tree_s2.py
similarity index 100%
rename from python/sfo_55ii_balanced_binary_tree_s2.py
rename to sword_for_offer/codes/python/sfo_55ii_balanced_binary_tree_s2.py
diff --git a/python/sfo_56i_single_number_i_s1.py b/sword_for_offer/codes/python/sfo_56i_single_number_i_s1.py
similarity index 100%
rename from python/sfo_56i_single_number_i_s1.py
rename to sword_for_offer/codes/python/sfo_56i_single_number_i_s1.py
diff --git a/python/sfo_56ii_single_number_ii_s1.py b/sword_for_offer/codes/python/sfo_56ii_single_number_ii_s1.py
similarity index 100%
rename from python/sfo_56ii_single_number_ii_s1.py
rename to sword_for_offer/codes/python/sfo_56ii_single_number_ii_s1.py
diff --git a/python/sfo_56ii_single_number_ii_s2.py b/sword_for_offer/codes/python/sfo_56ii_single_number_ii_s2.py
similarity index 100%
rename from python/sfo_56ii_single_number_ii_s2.py
rename to sword_for_offer/codes/python/sfo_56ii_single_number_ii_s2.py
diff --git a/python/sfo_57_two_numbers_with_sum_s_s1.py b/sword_for_offer/codes/python/sfo_57_two_numbers_with_sum_s_s1.py
similarity index 100%
rename from python/sfo_57_two_numbers_with_sum_s_s1.py
rename to sword_for_offer/codes/python/sfo_57_two_numbers_with_sum_s_s1.py
diff --git a/python/sfo_57ii_consecutive_numbers_with_sum_s_s1.py b/sword_for_offer/codes/python/sfo_57ii_consecutive_numbers_with_sum_s_s1.py
similarity index 100%
rename from python/sfo_57ii_consecutive_numbers_with_sum_s_s1.py
rename to sword_for_offer/codes/python/sfo_57ii_consecutive_numbers_with_sum_s_s1.py
diff --git a/python/sfo_57ii_consecutive_numbers_with_sum_s_s2.py b/sword_for_offer/codes/python/sfo_57ii_consecutive_numbers_with_sum_s_s2.py
similarity index 100%
rename from python/sfo_57ii_consecutive_numbers_with_sum_s_s2.py
rename to sword_for_offer/codes/python/sfo_57ii_consecutive_numbers_with_sum_s_s2.py
diff --git a/python/sfo_58i_reverse_order_of_words_s1.py b/sword_for_offer/codes/python/sfo_58i_reverse_order_of_words_s1.py
similarity index 100%
rename from python/sfo_58i_reverse_order_of_words_s1.py
rename to sword_for_offer/codes/python/sfo_58i_reverse_order_of_words_s1.py
diff --git a/python/sfo_58i_reverse_order_of_words_s2.py b/sword_for_offer/codes/python/sfo_58i_reverse_order_of_words_s2.py
similarity index 100%
rename from python/sfo_58i_reverse_order_of_words_s2.py
rename to sword_for_offer/codes/python/sfo_58i_reverse_order_of_words_s2.py
diff --git a/python/sfo_58i_reverse_order_of_words_s3.py b/sword_for_offer/codes/python/sfo_58i_reverse_order_of_words_s3.py
similarity index 100%
rename from python/sfo_58i_reverse_order_of_words_s3.py
rename to sword_for_offer/codes/python/sfo_58i_reverse_order_of_words_s3.py
diff --git a/python/sfo_58ii_left_rotation_of_a_string_s1.py b/sword_for_offer/codes/python/sfo_58ii_left_rotation_of_a_string_s1.py
similarity index 100%
rename from python/sfo_58ii_left_rotation_of_a_string_s1.py
rename to sword_for_offer/codes/python/sfo_58ii_left_rotation_of_a_string_s1.py
diff --git a/python/sfo_58ii_left_rotation_of_a_string_s2.py b/sword_for_offer/codes/python/sfo_58ii_left_rotation_of_a_string_s2.py
similarity index 100%
rename from python/sfo_58ii_left_rotation_of_a_string_s2.py
rename to sword_for_offer/codes/python/sfo_58ii_left_rotation_of_a_string_s2.py
diff --git a/python/sfo_58ii_left_rotation_of_a_string_s3.py b/sword_for_offer/codes/python/sfo_58ii_left_rotation_of_a_string_s3.py
similarity index 100%
rename from python/sfo_58ii_left_rotation_of_a_string_s3.py
rename to sword_for_offer/codes/python/sfo_58ii_left_rotation_of_a_string_s3.py
diff --git a/python/sfo_58ii_left_rotation_of_a_string_s4.py b/sword_for_offer/codes/python/sfo_58ii_left_rotation_of_a_string_s4.py
similarity index 100%
rename from python/sfo_58ii_left_rotation_of_a_string_s4.py
rename to sword_for_offer/codes/python/sfo_58ii_left_rotation_of_a_string_s4.py
diff --git a/python/sfo_58ii_left_rotation_of_a_string_s5.py b/sword_for_offer/codes/python/sfo_58ii_left_rotation_of_a_string_s5.py
similarity index 100%
rename from python/sfo_58ii_left_rotation_of_a_string_s5.py
rename to sword_for_offer/codes/python/sfo_58ii_left_rotation_of_a_string_s5.py
diff --git a/python/sfo_59i_sliding_window_maximum_s1.py b/sword_for_offer/codes/python/sfo_59i_sliding_window_maximum_s1.py
similarity index 100%
rename from python/sfo_59i_sliding_window_maximum_s1.py
rename to sword_for_offer/codes/python/sfo_59i_sliding_window_maximum_s1.py
diff --git a/python/sfo_59i_sliding_window_maximum_s2.py b/sword_for_offer/codes/python/sfo_59i_sliding_window_maximum_s2.py
similarity index 100%
rename from python/sfo_59i_sliding_window_maximum_s2.py
rename to sword_for_offer/codes/python/sfo_59i_sliding_window_maximum_s2.py
diff --git a/python/sfo_59ii_max_queue_s1.py b/sword_for_offer/codes/python/sfo_59ii_max_queue_s1.py
similarity index 100%
rename from python/sfo_59ii_max_queue_s1.py
rename to sword_for_offer/codes/python/sfo_59ii_max_queue_s1.py
diff --git a/python/sfo_60_probabilities_for_rolling_n_dices_s1.py b/sword_for_offer/codes/python/sfo_60_probabilities_for_rolling_n_dices_s1.py
similarity index 100%
rename from python/sfo_60_probabilities_for_rolling_n_dices_s1.py
rename to sword_for_offer/codes/python/sfo_60_probabilities_for_rolling_n_dices_s1.py
diff --git a/python/sfo_61_straight_in_poker_s1.py b/sword_for_offer/codes/python/sfo_61_straight_in_poker_s1.py
similarity index 100%
rename from python/sfo_61_straight_in_poker_s1.py
rename to sword_for_offer/codes/python/sfo_61_straight_in_poker_s1.py
diff --git a/python/sfo_61_straight_in_poker_s2.py b/sword_for_offer/codes/python/sfo_61_straight_in_poker_s2.py
similarity index 100%
rename from python/sfo_61_straight_in_poker_s2.py
rename to sword_for_offer/codes/python/sfo_61_straight_in_poker_s2.py
diff --git a/python/sfo_62_josephus_problem_s1.py b/sword_for_offer/codes/python/sfo_62_josephus_problem_s1.py
similarity index 100%
rename from python/sfo_62_josephus_problem_s1.py
rename to sword_for_offer/codes/python/sfo_62_josephus_problem_s1.py
diff --git a/python/sfo_63_the_maximum_profit_of_stocks_s1.py b/sword_for_offer/codes/python/sfo_63_the_maximum_profit_of_stocks_s1.py
similarity index 100%
rename from python/sfo_63_the_maximum_profit_of_stocks_s1.py
rename to sword_for_offer/codes/python/sfo_63_the_maximum_profit_of_stocks_s1.py
diff --git a/python/sfo_64_solve_1_2___n_s1.py b/sword_for_offer/codes/python/sfo_64_solve_1_2___n_s1.py
similarity index 100%
rename from python/sfo_64_solve_1_2___n_s1.py
rename to sword_for_offer/codes/python/sfo_64_solve_1_2___n_s1.py
diff --git a/python/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.py b/sword_for_offer/codes/python/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.py
similarity index 100%
rename from python/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.py
rename to sword_for_offer/codes/python/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.py
diff --git a/python/sfo_66_a_product_array_puzzle_s1.py b/sword_for_offer/codes/python/sfo_66_a_product_array_puzzle_s1.py
similarity index 100%
rename from python/sfo_66_a_product_array_puzzle_s1.py
rename to sword_for_offer/codes/python/sfo_66_a_product_array_puzzle_s1.py
diff --git a/python/sfo_67_convert_string_to_int_s1.py b/sword_for_offer/codes/python/sfo_67_convert_string_to_int_s1.py
similarity index 100%
rename from python/sfo_67_convert_string_to_int_s1.py
rename to sword_for_offer/codes/python/sfo_67_convert_string_to_int_s1.py
diff --git a/python/sfo_67_convert_string_to_int_s2.py b/sword_for_offer/codes/python/sfo_67_convert_string_to_int_s2.py
similarity index 100%
rename from python/sfo_67_convert_string_to_int_s2.py
rename to sword_for_offer/codes/python/sfo_67_convert_string_to_int_s2.py
diff --git a/python/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.py b/sword_for_offer/codes/python/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.py
similarity index 100%
rename from python/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.py
rename to sword_for_offer/codes/python/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s1.py
diff --git a/python/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.py b/sword_for_offer/codes/python/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.py
similarity index 100%
rename from python/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.py
rename to sword_for_offer/codes/python/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s2.py
diff --git a/python/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.py b/sword_for_offer/codes/python/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.py
similarity index 100%
rename from python/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.py
rename to sword_for_offer/codes/python/sfo_68i_the_nearest_common_ancestor_of_a_binary_search_tree_s3.py
diff --git a/python/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.py b/sword_for_offer/codes/python/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.py
similarity index 100%
rename from python/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.py
rename to sword_for_offer/codes/python/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s1.py
diff --git a/python/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.py b/sword_for_offer/codes/python/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.py
similarity index 100%
rename from python/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.py
rename to sword_for_offer/codes/python/sfo_68ii_the_nearest_common_ancestor_of_a_binary_tree_s2.py
From 04658dd33363d6e7269aa4864136a0d4a1f39d84 Mon Sep 17 00:00:00 2001
From: krahets
Date: Tue, 10 Oct 2023 19:49:12 +0800
Subject: [PATCH 09/23] Format the docs and codes.
---
.../codes/cpp/include/ListNode.hpp | 23 +-
.../codes/cpp/include/PrintUtil.hpp | 323 ++++++++--------
.../codes/cpp/include/TreeNode.hpp | 31 +-
sword_for_offer/codes/cpp/include/include.hpp | 12 +-
..._find_duplicate_numbers_in_an_array_s2.cpp | 26 +-
.../sfo_04_find_a_number_in_2d_matrix_s1.cpp | 35 +-
.../sfo_05_replace_spaces_s1.cpp | 19 +-
...rint_a_linked_list_in_reverse_order_s1.cpp | 26 +-
...rint_a_linked_list_in_reverse_order_s2.cpp | 22 +-
.../sfo_07_reconstruct_binary_tree_s1.cpp | 34 +-
..._implement_a_queue_using_two_stacks_s1.cpp | 22 +-
.../sfo_10i_fibonacci_numbers_s1.cpp | 16 +-
.../sfo_10ii_frog_jump_s1.cpp | 16 +-
...ind_minimum_in_rotated_sorted_array_s1.cpp | 27 +-
...ind_minimum_in_rotated_sorted_array_s2.cpp | 29 +-
.../sfo_12_word_search_s1.cpp | 44 +--
.../sfo_13_range_of_motion_of_a_robot_s1.cpp | 22 +-
.../sfo_13_range_of_motion_of_a_robot_s2.cpp | 25 +-
.../sfo_14i_cut_the_rope_i_s1.cpp | 23 +-
.../sfo_14ii_cut_the_rope_ii_s1.cpp | 28 +-
.../sfo_15_number_of_1_bits_s1.cpp | 16 +-
.../sfo_15_number_of_1_bits_s2.cpp | 16 +-
.../sfo_16_powers_of_integers_s1.cpp | 24 +-
...18_delete_a_node_from_a_linked_list_s1.cpp | 28 +-
.../sfo_19_regular_expression_matching_s1.cpp | 25 +-
.../sfo_19_regular_expression_matching_s2.cpp | 37 +-
...st_the_order_of_numbers_in_an_array_s1.cpp | 27 +-
..._node_from_the_end_of_a_linked_list_s1.cpp | 24 +-
..._node_from_the_end_of_a_linked_list_s2.cpp | 27 +-
.../sfo_24_reverse_a_linked_list_s1.cpp | 24 +-
.../sfo_24_reverse_a_linked_list_s2.cpp | 32 +-
..._25_combine_two_sorted_linked_lists_s1.cpp | 33 +-
...fo_26_substructure_of_a_binary_tree_s1.cpp | 34 +-
.../sfo_27_mirror_of_a_binary_tree_s1.cpp | 26 +-
.../sfo_27_mirror_of_a_binary_tree_s2.cpp | 39 +-
.../sfo_28_symmetric_binary_tree_s1.cpp | 30 +-
...print_a_given_matrix_in_spiral_form_s1.cpp | 52 +--
.../sfo_30_min_stack_s1.cpp | 19 +-
.../sfo_31_validate_stack_sequences_s1.cpp | 26 +-
...32i_print_a_binary_tree_topbottom_i_s1.cpp | 33 +-
...ii_print_a_binary_tree_topbottom_ii_s1.cpp | 33 +-
...i_print_a_binary_tree_topbottom_iii_s1.cpp | 48 ++-
...i_print_a_binary_tree_topbottom_iii_s2.cpp | 38 +-
...r_traversal_of_a_binary_search_tree_s1.cpp | 32 +-
...r_traversal_of_a_binary_search_tree_s2.cpp | 25 +-
..._34_all_xsum_paths_in_a_binary_tree_s1.cpp | 30 +-
...d_list_with_next_and_random_pointer_s1.cpp | 46 +--
...d_list_with_next_and_random_pointer_s2.cpp | 54 +--
..._search_tree_and_doubly_linked_list_s1.cpp | 48 +--
...alize_and_deserialize_a_binary_tree_s1.cpp | 43 ++-
...sfo_38_all_permutations_of_a_string_s1.cpp | 32 +-
...39_the_majority_element_in_an_array_s1.cpp | 23 +-
...39_the_majority_element_in_an_array_s2.cpp | 28 +-
.../sfo_40_the_smallest_k_numbers_s1.cpp | 32 +-
.../sfo_40_the_smallest_k_numbers_s2.cpp | 38 +-
...sfo_41_find_median_from_data_stream_s1.cpp | 19 +-
..._42_largest_sum_contiguous_subarray_s1.cpp | 28 +-
...number_of_1_in_integers_from_1_to_n_s1.cpp | 25 +-
.../sfo_44_nth_digit_s1.cpp | 16 +-
...e_an_array_into_the_smallest_number_s1.cpp | 38 +-
...e_an_array_into_the_smallest_number_s2.cpp | 24 +-
...o_46_translate_numbers_into_strings_s1.cpp | 16 +-
...o_46_translate_numbers_into_strings_s2.cpp | 16 +-
...o_46_translate_numbers_into_strings_s3.cpp | 16 +-
.../sfo_47_the_maximum_value_of_gifts_s1.cpp | 38 +-
.../sfo_47_the_maximum_value_of_gifts_s2.cpp | 30 +-
...bstring_without_repeated_characters_s1.cpp | 26 +-
...bstring_without_repeated_characters_s2.cpp | 21 +-
...bstring_without_repeated_characters_s3.cpp | 22 +-
.../sfo_49_ugly_numbers_s1.cpp | 25 +-
..._nonrepeating_character_in_a_string_s1.cpp | 21 +-
..._nonrepeating_character_in_a_string_s2.cpp | 23 +-
.../sfo_51_reversed_pairs_in_an_array_s1.cpp | 26 +-
...rst_common_node_in_two_linked_lists_s1.cpp | 24 +-
...53i_find_a_number_in_a_sorted_array_s1.cpp | 40 +-
...53i_find_a_number_in_a_sorted_array_s2.cpp | 31 +-
...3ii_the_missing_number_from_0_to_n1_s1.cpp | 26 +-
...argest_node_of_a_binary_search_tree_s1.cpp | 32 +-
.../sfo_55i_depth_of_a_binary_tree_s1.cpp | 21 +-
.../sfo_55i_depth_of_a_binary_tree_s2.cpp | 35 +-
.../sfo_55ii_balanced_binary_tree_s1.cpp | 32 +-
.../sfo_55ii_balanced_binary_tree_s2.cpp | 29 +-
.../sfo_56i_single_number_i_s1.cpp | 32 +-
.../sfo_56ii_single_number_ii_s1.cpp | 20 +-
.../sfo_56ii_single_number_ii_s2.cpp | 28 +-
.../sfo_57_two_numbers_with_sum_s_s1.cpp | 29 +-
...57ii_consecutive_numbers_with_sum_s_s1.cpp | 22 +-
...57ii_consecutive_numbers_with_sum_s_s2.cpp | 22 +-
.../sfo_58ii_left_rotation_of_a_string_s1.cpp | 14 +-
.../sfo_58ii_left_rotation_of_a_string_s2.cpp | 22 +-
.../sfo_58ii_left_rotation_of_a_string_s3.cpp | 14 +-
.../sfo_59ii_max_queue_s1.cpp | 23 +-
...0_probabilities_for_rolling_n_dices_s1.cpp | 14 +-
.../sfo_61_straight_in_poker_s1.cpp | 26 +-
.../sfo_61_straight_in_poker_s2.cpp | 26 +-
.../sfo_62_josephus_problem_s1.cpp | 14 +-
...sfo_63_the_maximum_profit_of_stocks_s1.cpp | 20 +-
.../sfo_64_solve_1_2___n_s1.cpp | 14 +-
...ration_without_arithmetic_operators_s1.cpp | 17 +-
.../sfo_66_a_product_array_puzzle_s1.cpp | 25 +-
.../sfo_67_convert_string_to_int_s1.cpp | 35 +-
...on_ancestor_of_a_binary_search_tree_s1.cpp | 38 +-
...on_ancestor_of_a_binary_search_tree_s2.cpp | 40 +-
...on_ancestor_of_a_binary_search_tree_s3.cpp | 29 +-
...st_common_ancestor_of_a_binary_tree_s1.cpp | 34 +-
...st_common_ancestor_of_a_binary_tree_s2.cpp | 39 +-
.../codes/java/include/ListNode.java | 4 +-
.../codes/java/include/PrintUtil.java | 3 +
.../codes/java/include/TreeNode.java | 33 +-
...find_duplicate_numbers_in_an_array_s1.java | 5 +-
...find_duplicate_numbers_in_an_array_s2.java | 7 +-
.../sfo_04_find_a_number_in_2d_matrix_s1.java | 22 +-
.../sfo_05_replace_spaces_s1.java | 9 +-
...int_a_linked_list_in_reverse_order_s1.java | 7 +-
...int_a_linked_list_in_reverse_order_s2.java | 6 +-
.../sfo_07_reconstruct_binary_tree_s1.java | 15 +-
...implement_a_queue_using_two_stacks_s1.java | 11 +-
.../sfo_10i_fibonacci_numbers_s1.java | 2 +-
.../sfo_10ii_frog_jump_s1.java | 2 +-
...nd_minimum_in_rotated_sorted_array_s1.java | 9 +-
...nd_minimum_in_rotated_sorted_array_s2.java | 11 +-
.../sfo_12_word_search_s1.java | 26 +-
.../sfo_13_range_of_motion_of_a_robot_s1.java | 12 +-
.../sfo_13_range_of_motion_of_a_robot_s2.java | 9 +-
.../sfo_14i_cut_the_rope_i_s1.java | 11 +-
.../sfo_14ii_cut_the_rope_ii_s1.java | 16 +-
.../sfo_15_number_of_1_bits_s1.java | 2 +-
.../sfo_15_number_of_1_bits_s2.java | 2 +-
.../sfo_16_powers_of_integers_s1.java | 10 +-
...int_from_1_to_the_largest_n_digits_s1.java | 4 +-
...int_from_1_to_the_largest_n_digits_s2.java | 8 +-
...int_from_1_to_the_largest_n_digits_s3.java | 17 +-
...int_from_1_to_the_largest_n_digits_s4.java | 19 +-
...8_delete_a_node_from_a_linked_list_s1.java | 8 +-
...sfo_19_regular_expression_matching_s1.java | 12 +-
...sfo_19_regular_expression_matching_s2.java | 23 +-
...tring_representing_a_numeric_value_s1.java | 87 ++++-
...t_the_order_of_numbers_in_an_array_s1.java | 8 +-
...node_from_the_end_of_a_linked_list_s1.java | 4 +-
...node_from_the_end_of_a_linked_list_s2.java | 7 +-
.../sfo_24_reverse_a_linked_list_s1.java | 8 +-
.../sfo_24_reverse_a_linked_list_s2.java | 12 +-
...25_combine_two_sorted_linked_lists_s1.java | 7 +-
...o_26_substructure_of_a_binary_tree_s1.java | 7 +-
.../sfo_27_mirror_of_a_binary_tree_s1.java | 6 +-
.../sfo_27_mirror_of_a_binary_tree_s2.java | 20 +-
.../sfo_28_symmetric_binary_tree_s1.java | 10 +-
...rint_a_given_matrix_in_spiral_form_s1.java | 37 +-
.../sfo_30_min_stack_s1.java | 9 +-
.../sfo_31_validate_stack_sequences_s1.java | 4 +-
...2i_print_a_binary_tree_topbottom_i_s1.java | 19 +-
...i_print_a_binary_tree_topbottom_ii_s1.java | 16 +-
..._print_a_binary_tree_topbottom_iii_s1.java | 22 +-
..._print_a_binary_tree_topbottom_iii_s2.java | 27 +-
..._print_a_binary_tree_topbottom_iii_s3.java | 19 +-
..._traversal_of_a_binary_search_tree_s1.java | 10 +-
..._traversal_of_a_binary_search_tree_s2.java | 7 +-
...34_all_xsum_paths_in_a_binary_tree_s1.java | 13 +-
..._list_with_next_and_random_pointer_s1.java | 7 +-
..._list_with_next_and_random_pointer_s2.java | 13 +-
...search_tree_and_doubly_linked_list_s1.java | 30 +-
...lize_and_deserialize_a_binary_tree_s1.java | 32 +-
...fo_38_all_permutations_of_a_string_s1.java | 18 +-
...9_the_majority_element_in_an_array_s1.java | 5 +-
...9_the_majority_element_in_an_array_s2.java | 10 +-
.../sfo_40_the_smallest_k_numbers_s1.java | 11 +-
.../sfo_40_the_smallest_k_numbers_s2.java | 17 +-
...fo_41_find_median_from_data_stream_s1.java | 5 +-
...42_largest_sum_contiguous_subarray_s1.java | 2 +-
...umber_of_1_in_integers_from_1_to_n_s1.java | 11 +-
..._an_array_into_the_smallest_number_s1.java | 16 +-
..._an_array_into_the_smallest_number_s2.java | 4 +-
..._46_translate_numbers_into_strings_s1.java | 2 +-
..._46_translate_numbers_into_strings_s2.java | 2 +-
..._46_translate_numbers_into_strings_s3.java | 2 +-
.../sfo_47_the_maximum_value_of_gifts_s1.java | 24 +-
.../sfo_47_the_maximum_value_of_gifts_s2.java | 16 +-
...string_without_repeated_characters_s1.java | 2 +-
...string_without_repeated_characters_s2.java | 5 +-
...string_without_repeated_characters_s3.java | 4 +-
.../sfo_49_ugly_numbers_s1.java | 11 +-
...nonrepeating_character_in_a_string_s1.java | 7 +-
...nonrepeating_character_in_a_string_s2.java | 7 +-
.../sfo_51_reversed_pairs_in_an_array_s1.java | 5 +-
...st_common_node_in_two_linked_lists_s1.java | 2 +-
...3i_find_a_number_in_a_sorted_array_s1.java | 22 +-
...3i_find_a_number_in_a_sorted_array_s2.java | 9 +-
...ii_the_missing_number_from_0_to_n1_s1.java | 8 +-
...rgest_node_of_a_binary_search_tree_s1.java | 11 +-
.../sfo_55i_depth_of_a_binary_tree_s1.java | 3 +-
.../sfo_55i_depth_of_a_binary_tree_s2.java | 19 +-
.../sfo_55ii_balanced_binary_tree_s1.java | 9 +-
.../sfo_55ii_balanced_binary_tree_s2.java | 6 +-
.../sfo_56i_single_number_i_s1.java | 14 +-
.../sfo_56ii_single_number_ii_s1.java | 2 +-
.../sfo_56ii_single_number_ii_s2.java | 10 +-
.../sfo_57_two_numbers_with_sum_s_s1.java | 11 +-
...7ii_consecutive_numbers_with_sum_s_s1.java | 8 +-
...7ii_consecutive_numbers_with_sum_s_s2.java | 8 +-
.../sfo_58i_reverse_order_of_words_s1.java | 12 +-
.../sfo_58i_reverse_order_of_words_s2.java | 9 +-
...sfo_58ii_left_rotation_of_a_string_s2.java | 4 +-
...sfo_58ii_left_rotation_of_a_string_s3.java | 2 +-
...sfo_58ii_left_rotation_of_a_string_s4.java | 4 +-
...sfo_58ii_left_rotation_of_a_string_s5.java | 2 +-
.../sfo_59i_sliding_window_maximum_s1.java | 11 +-
.../sfo_59i_sliding_window_maximum_s2.java | 13 +-
.../sfo_59ii_max_queue_s1.java | 11 +-
.../sfo_61_straight_in_poker_s1.java | 8 +-
.../sfo_61_straight_in_poker_s2.java | 8 +-
...fo_63_the_maximum_profit_of_stocks_s1.java | 2 +-
.../sfo_64_solve_1_2___n_s1.java | 1 +
...ation_without_arithmetic_operators_s1.java | 4 +-
.../sfo_66_a_product_array_puzzle_s1.java | 7 +-
.../sfo_67_convert_string_to_int_s1.java | 17 +-
.../sfo_67_convert_string_to_int_s2.java | 21 +-
...n_ancestor_of_a_binary_search_tree_s1.java | 12 +-
...n_ancestor_of_a_binary_search_tree_s2.java | 14 +-
...n_ancestor_of_a_binary_search_tree_s3.java | 7 +-
...t_common_ancestor_of_a_binary_tree_s1.java | 12 +-
...t_common_ancestor_of_a_binary_tree_s2.java | 15 +-
.../codes/python/include/__init__.py | 9 +-
.../codes/python/include/binary_tree.py | 22 +-
.../codes/python/include/linked_list.py | 18 +-
.../codes/python/include/print_util.py | 44 ++-
...3_find_duplicate_numbers_in_an_array_s1.py | 9 +-
...3_find_duplicate_numbers_in_an_array_s2.py | 9 +-
.../sfo_04_find_a_number_in_2d_matrix_s1.py | 17 +-
.../codes/python/sfo_05_replace_spaces_s1.py | 12 +-
...print_a_linked_list_in_reverse_order_s1.py | 6 +-
...print_a_linked_list_in_reverse_order_s2.py | 6 +-
.../sfo_07_reconstruct_binary_tree_s1.py | 19 +-
...9_implement_a_queue_using_two_stacks_s1.py | 14 +-
.../python/sfo_10i_fibonacci_numbers_s1.py | 6 +-
.../python/sfo_10i_fibonacci_numbers_s2.py | 6 +-
.../codes/python/sfo_10ii_frog_jump_s1.py | 6 +-
.../codes/python/sfo_10ii_frog_jump_s2.py | 6 +-
...find_minimum_in_rotated_sorted_array_s1.py | 15 +-
...find_minimum_in_rotated_sorted_array_s2.py | 15 +-
.../codes/python/sfo_12_word_search_s1.py | 34 +-
.../sfo_13_range_of_motion_of_a_robot_s1.py | 17 +-
.../sfo_13_range_of_motion_of_a_robot_s2.py | 11 +-
.../codes/python/sfo_14i_cut_the_rope_i_s1.py | 15 +-
.../python/sfo_14ii_cut_the_rope_ii_s1.py | 24 +-
.../python/sfo_14ii_cut_the_rope_ii_s2.py | 17 +-
.../python/sfo_15_number_of_1_bits_s1.py | 6 +-
.../python/sfo_15_number_of_1_bits_s2.py | 6 +-
.../python/sfo_16_powers_of_integers_s1.py | 15 +-
...print_from_1_to_the_largest_n_digits_s1.py | 8 +-
...print_from_1_to_the_largest_n_digits_s2.py | 26 +-
...print_from_1_to_the_largest_n_digits_s3.py | 23 +-
...print_from_1_to_the_largest_n_digits_s4.py | 21 +-
..._18_delete_a_node_from_a_linked_list_s1.py | 12 +-
.../sfo_19_regular_expression_matching_s1.py | 18 +-
.../sfo_19_regular_expression_matching_s2.py | 25 +-
..._string_representing_a_numeric_value_s1.py | 44 ++-
...ust_the_order_of_numbers_in_an_array_s1.py | 12 +-
...h_node_from_the_end_of_a_linked_list_s1.py | 6 +-
...h_node_from_the_end_of_a_linked_list_s2.py | 9 +-
.../python/sfo_24_reverse_a_linked_list_s1.py | 14 +-
.../python/sfo_24_reverse_a_linked_list_s2.py | 6 +-
.../python/sfo_24_reverse_a_linked_list_s3.py | 19 +-
...o_25_combine_two_sorted_linked_lists_s1.py | 6 +-
...sfo_26_substructure_of_a_binary_tree_s1.py | 18 +-
.../sfo_27_mirror_of_a_binary_tree_s1.py | 13 +-
.../sfo_27_mirror_of_a_binary_tree_s2.py | 13 +-
.../sfo_27_mirror_of_a_binary_tree_s3.py | 19 +-
.../python/sfo_28_symmetric_binary_tree_s1.py | 16 +-
..._print_a_given_matrix_in_spiral_form_s1.py | 39 +-
.../codes/python/sfo_30_min_stack_s1.py | 8 +-
.../sfo_31_validate_stack_sequences_s1.py | 10 +-
..._32i_print_a_binary_tree_topbottom_i_s1.py | 15 +-
...2ii_print_a_binary_tree_topbottom_ii_s1.py | 15 +-
...ii_print_a_binary_tree_topbottom_iii_s1.py | 21 +-
...ii_print_a_binary_tree_topbottom_iii_s2.py | 24 +-
...ii_print_a_binary_tree_topbottom_iii_s3.py | 15 +-
...er_traversal_of_a_binary_search_tree_s1.py | 15 +-
...er_traversal_of_a_binary_search_tree_s2.py | 11 +-
...o_34_all_xsum_paths_in_a_binary_tree_s1.py | 36 +-
...ed_list_with_next_and_random_pointer_s1.py | 25 +-
...ed_list_with_next_and_random_pointer_s2.py | 29 +-
...y_search_tree_and_doubly_linked_list_s1.py | 29 +-
...ialize_and_deserialize_a_binary_tree_s1.py | 19 +-
.../sfo_38_all_permutations_of_a_string_s1.py | 15 +-
..._39_the_majority_element_in_an_array_s1.py | 9 +-
..._39_the_majority_element_in_an_array_s2.py | 14 +-
.../sfo_40_the_smallest_k_numbers_s1.py | 17 +-
.../sfo_40_the_smallest_k_numbers_s2.py | 24 +-
.../sfo_41_find_median_from_data_stream_s1.py | 16 +-
.../sfo_41_find_median_from_data_stream_s2.py | 16 +-
...o_42_largest_sum_contiguous_subarray_s1.py | 6 +-
..._number_of_1_in_integers_from_1_to_n_s1.py | 15 +-
.../codes/python/sfo_44_nth_digit_s1.py | 12 +-
...ge_an_array_into_the_smallest_number_s1.py | 21 +-
...ge_an_array_into_the_smallest_number_s2.py | 21 +-
...fo_46_translate_numbers_into_strings_s1.py | 8 +-
...fo_46_translate_numbers_into_strings_s2.py | 8 +-
...fo_46_translate_numbers_into_strings_s3.py | 8 +-
...fo_46_translate_numbers_into_strings_s4.py | 6 +-
...fo_46_translate_numbers_into_strings_s5.py | 6 +-
.../sfo_47_the_maximum_value_of_gifts_s1.py | 24 +-
.../sfo_47_the_maximum_value_of_gifts_s2.py | 16 +-
...ubstring_without_repeated_characters_s1.py | 14 +-
...ubstring_without_repeated_characters_s2.py | 13 +-
...ubstring_without_repeated_characters_s3.py | 12 +-
.../codes/python/sfo_49_ugly_numbers_s1.py | 15 +-
...t_nonrepeating_character_in_a_string_s1.py | 11 +-
...t_nonrepeating_character_in_a_string_s2.py | 11 +-
...t_nonrepeating_character_in_a_string_s3.py | 11 +-
.../sfo_51_reversed_pairs_in_an_array_s1.py | 15 +-
...irst_common_node_in_two_linked_lists_s1.py | 8 +-
..._53i_find_a_number_in_a_sorted_array_s1.py | 21 +-
..._53i_find_a_number_in_a_sorted_array_s2.py | 13 +-
...53ii_the_missing_number_from_0_to_n1_s1.py | 12 +-
...largest_node_of_a_binary_search_tree_s1.py | 15 +-
.../sfo_55i_depth_of_a_binary_tree_s1.py | 9 +-
.../sfo_55i_depth_of_a_binary_tree_s2.py | 15 +-
.../sfo_55ii_balanced_binary_tree_s1.py | 15 +-
.../sfo_55ii_balanced_binary_tree_s2.py | 19 +-
.../python/sfo_56i_single_number_i_s1.py | 22 +-
.../python/sfo_56ii_single_number_ii_s1.py | 6 +-
.../python/sfo_56ii_single_number_ii_s2.py | 14 +-
.../sfo_57_two_numbers_with_sum_s_s1.py | 15 +-
..._57ii_consecutive_numbers_with_sum_s_s1.py | 6 +-
..._57ii_consecutive_numbers_with_sum_s_s2.py | 6 +-
.../sfo_58i_reverse_order_of_words_s1.py | 20 +-
.../sfo_58i_reverse_order_of_words_s2.py | 14 +-
.../sfo_58i_reverse_order_of_words_s3.py | 8 +-
.../sfo_58ii_left_rotation_of_a_string_s1.py | 6 +-
.../sfo_58ii_left_rotation_of_a_string_s2.py | 8 +-
.../sfo_58ii_left_rotation_of_a_string_s3.py | 8 +-
.../sfo_58ii_left_rotation_of_a_string_s4.py | 6 +-
.../sfo_58ii_left_rotation_of_a_string_s5.py | 6 +-
.../sfo_59i_sliding_window_maximum_s1.py | 6 +-
.../sfo_59i_sliding_window_maximum_s2.py | 9 +-
.../codes/python/sfo_59ii_max_queue_s1.py | 11 +-
...60_probabilities_for_rolling_n_dices_s1.py | 6 +-
.../python/sfo_61_straight_in_poker_s1.py | 20 +-
.../python/sfo_61_straight_in_poker_s2.py | 16 +-
.../python/sfo_62_josephus_problem_s1.py | 6 +-
.../sfo_63_the_maximum_profit_of_stocks_s1.py | 6 +-
.../codes/python/sfo_64_solve_1_2___n_s1.py | 7 +-
...eration_without_arithmetic_operators_s1.py | 10 +-
.../sfo_66_a_product_array_puzzle_s1.py | 12 +-
.../python/sfo_67_convert_string_to_int_s1.py | 27 +-
.../python/sfo_67_convert_string_to_int_s2.py | 29 +-
...mon_ancestor_of_a_binary_search_tree_s1.py | 45 ++-
...mon_ancestor_of_a_binary_search_tree_s2.py | 48 ++-
...mon_ancestor_of_a_binary_search_tree_s3.py | 34 +-
...est_common_ancestor_of_a_binary_tree_s1.py | 43 ++-
...est_common_ancestor_of_a_binary_tree_s2.py | 48 ++-
...15\347\232\204\346\225\260\345\255\227.md" | 138 +++++++
...55\347\232\204\346\237\245\346\211\276.md" | 73 ++++
...77\346\215\242\347\251\272\346\240\274.md" | 96 +++++
...23\345\215\260\351\223\276\350\241\250.md" | 130 +++++++
...72\344\272\214\345\217\211\346\240\221.md" | 117 ++++++
...36\347\216\260\351\230\237\345\210\227.md" | 95 +++++
...43\345\245\221\346\225\260\345\210\227.md" | 98 +++++
...60\351\230\266\351\227\256\351\242\230.md" | 105 +++++
...00\345\260\217\346\225\260\345\255\227.md" | 161 ++++++++
...55\347\232\204\350\267\257\345\276\204.md" | 101 +++++
...20\345\212\250\350\214\203\345\233\264.md" | 240 ++++++++++++
.... \345\211\252\347\273\263\345\255\220.md" | 164 ++++++++
...345\211\252\347\273\263\345\255\220 II.md" | 232 +++++++++++
...1 \347\232\204\344\270\252\346\225\260.md" | 123 ++++++
...64\346\225\260\346\254\241\346\226\271.md" | 128 +++++++
...347\232\204 n \344\275\215\346\225\260.md" | 268 +++++++++++++
...50\347\232\204\350\212\202\347\202\271.md" | 69 ++++
...76\345\274\217\345\214\271\351\205\215.md" | 185 +++++++++
...04\345\255\227\347\254\246\344\270\262.md" | 112 ++++++
...66\346\225\260\345\211\215\351\235\242.md" | 75 ++++
...k \344\270\252\350\212\202\347\202\271.md" | 117 ++++++
...15\350\275\254\351\223\276\350\241\250.md" | 138 +++++++
...17\347\232\204\351\223\276\350\241\250.md" | 88 +++++
...04\345\255\220\347\273\223\346\236\204.md" | 79 ++++
...21\347\232\204\351\225\234\345\203\217.md" | 151 ++++++++
...04\344\272\214\345\217\211\346\240\221.md" | 79 ++++
...23\345\215\260\347\237\251\351\230\265.md" | 106 ++++++
...75\346\225\260\347\232\204\346\240\210.md" | 115 ++++++
...71\345\207\272\345\272\217\345\210\227.md" | 82 ++++
...60\344\272\214\345\217\211\346\240\221.md" | 81 ++++
...344\272\214\345\217\211\346\240\221 II.md" | 94 +++++
...44\272\214\345\217\211\346\240\221 III.md" | 281 ++++++++++++++
...15\345\216\206\345\272\217\345\210\227.md" | 167 ++++++++
...74\347\232\204\350\267\257\345\276\204.md" | 105 +++++
...50\347\232\204\345\244\215\345\210\266.md" | 359 ++++++++++++++++++
...14\345\220\221\351\223\276\350\241\250.md" | 138 +++++++
...26\344\272\214\345\217\211\346\240\221.md" | 153 ++++++++
...62\347\232\204\346\216\222\345\210\227.md" | 117 ++++++
...12\347\232\204\346\225\260\345\255\227.md" | 134 +++++++
...347\232\204 k \344\270\252\346\225\260.md" | 213 +++++++++++
...04\344\270\255\344\275\215\346\225\260.md" | 134 +++++++
...04\346\234\200\345\244\247\345\222\214.md" | 79 ++++
...60\347\232\204\346\254\241\346\225\260.md" | 161 ++++++++
...15\347\232\204\346\225\260\345\255\227.md" | 167 ++++++++
...00\345\260\217\347\232\204\346\225\260.md" | 168 ++++++++
...20\345\255\227\347\254\246\344\270\262.md" | 237 ++++++++++++
...00\345\244\247\344\273\267\345\200\274.md" | 146 +++++++
...20\345\255\227\347\254\246\344\270\262.md" | 222 +++++++++++
...207 Offer 49. \344\270\221\346\225\260.md" | 115 ++++++
...41\347\232\204\345\255\227\347\254\246.md" | 148 ++++++++
...04\351\200\206\345\272\217\345\257\271.md" | 148 ++++++++
...54\345\205\261\350\212\202\347\202\271.md" | 81 ++++
...\346\211\276\346\225\260\345\255\227 I.md" | 170 +++++++++
...61\347\232\204\346\225\260\345\255\227.md" | 68 ++++
...k \345\244\247\350\212\202\347\202\271.md" | 148 ++++++++
...21\347\232\204\346\267\261\345\272\246.md" | 134 +++++++
...41\344\272\214\345\217\211\346\240\221.md" | 162 ++++++++
...60\347\232\204\346\254\241\346\225\260.md" | 190 +++++++++
...347\232\204\346\254\241\346\225\260 II.md" | 285 ++++++++++++++
...43\346\225\260\345\272\217\345\210\227.md" | 205 ++++++++++
...44\344\270\252\346\225\260\345\255\227.md" | 78 ++++
...25\350\257\215\351\241\272\345\272\217.md" | 103 +++++
...54\345\255\227\347\254\246\344\270\262.md" | 278 ++++++++++++++
...04\346\234\200\345\244\247\345\200\274.md" | 145 +++++++
...04\346\234\200\345\244\247\345\200\274.md" | 127 +++++++
...20\347\232\204\347\202\271\346\225\260.md" | 112 ++++++
...55\347\232\204\351\241\272\345\255\220.md" | 133 +++++++
...13\347\232\204\346\225\260\345\255\227.md" | 121 ++++++
...00\345\244\247\345\210\251\346\266\246.md" | 89 +++++
... \346\261\202 1 + 2 + \342\200\246 + n.md" | 151 ++++++++
...44\345\201\232\345\212\240\346\263\225.md" | 100 +++++
...30\347\247\257\346\225\260\347\273\204.md" | 76 ++++
...42\346\210\220\346\225\264\346\225\260.md" | 141 +++++++
...54\345\205\261\347\245\226\345\205\210.md" | 183 +++++++++
...54\345\205\261\347\245\226\345\205\210.md" | 125 ++++++
426 files changed, 14490 insertions(+), 2701 deletions(-)
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 03. \346\225\260\347\273\204\344\270\255\351\207\215\345\244\215\347\232\204\346\225\260\345\255\227.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 04. \344\272\214\347\273\264\346\225\260\347\273\204\344\270\255\347\232\204\346\237\245\346\211\276.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 05. \346\233\277\346\215\242\347\251\272\346\240\274.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 06. \344\273\216\345\260\276\345\210\260\345\244\264\346\211\223\345\215\260\351\223\276\350\241\250.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 07. \351\207\215\345\273\272\344\272\214\345\217\211\346\240\221.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 09. \347\224\250\344\270\244\344\270\252\346\240\210\345\256\236\347\216\260\351\230\237\345\210\227.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 10- I. \346\226\220\346\263\242\351\202\243\345\245\221\346\225\260\345\210\227.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 10- II. \351\235\222\350\233\231\350\267\263\345\217\260\351\230\266\351\227\256\351\242\230.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 11. \346\227\213\350\275\254\346\225\260\347\273\204\347\232\204\346\234\200\345\260\217\346\225\260\345\255\227.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 12. \347\237\251\351\230\265\344\270\255\347\232\204\350\267\257\345\276\204.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 13. \346\234\272\345\231\250\344\272\272\347\232\204\350\277\220\345\212\250\350\214\203\345\233\264.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 14- I. \345\211\252\347\273\263\345\255\220.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 14- II. \345\211\252\347\273\263\345\255\220 II.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 15. \344\272\214\350\277\233\345\210\266\344\270\255 1 \347\232\204\344\270\252\346\225\260.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 16. \346\225\260\345\200\274\347\232\204\346\225\264\346\225\260\346\254\241\346\226\271.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 17. \346\211\223\345\215\260\344\273\216 1 \345\210\260\346\234\200\345\244\247\347\232\204 n \344\275\215\346\225\260.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 18. \345\210\240\351\231\244\351\223\276\350\241\250\347\232\204\350\212\202\347\202\271.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 19. \346\255\243\345\210\231\350\241\250\350\276\276\345\274\217\345\214\271\351\205\215.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 20. \350\241\250\347\244\272\346\225\260\345\200\274\347\232\204\345\255\227\347\254\246\344\270\262.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 21. \350\260\203\346\225\264\346\225\260\347\273\204\351\241\272\345\272\217\344\275\277\345\245\207\346\225\260\344\275\215\344\272\216\345\201\266\346\225\260\345\211\215\351\235\242.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 22. \351\223\276\350\241\250\344\270\255\345\200\222\346\225\260\347\254\254 k \344\270\252\350\212\202\347\202\271.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 24. \345\217\215\350\275\254\351\223\276\350\241\250.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 25. \345\220\210\345\271\266\344\270\244\344\270\252\346\216\222\345\272\217\347\232\204\351\223\276\350\241\250.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 26. \346\240\221\347\232\204\345\255\220\347\273\223\346\236\204.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 27. \344\272\214\345\217\211\346\240\221\347\232\204\351\225\234\345\203\217.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 28. \345\257\271\347\247\260\347\232\204\344\272\214\345\217\211\346\240\221.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 29. \351\241\272\346\227\266\351\222\210\346\211\223\345\215\260\347\237\251\351\230\265.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 30. \345\214\205\345\220\253 min \345\207\275\346\225\260\347\232\204\346\240\210.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 31. \346\240\210\347\232\204\345\216\213\345\205\245\343\200\201\345\274\271\345\207\272\345\272\217\345\210\227.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 32 - I. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 32 - II. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221 II.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 32 - III. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221 III.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 33. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\345\220\216\345\272\217\351\201\215\345\216\206\345\272\217\345\210\227.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 34. \344\272\214\345\217\211\346\240\221\344\270\255\345\222\214\344\270\272\346\237\220\344\270\200\345\200\274\347\232\204\350\267\257\345\276\204.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 35. \345\244\215\346\235\202\351\223\276\350\241\250\347\232\204\345\244\215\345\210\266.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 36. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\344\270\216\345\217\214\345\220\221\351\223\276\350\241\250.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 37. \345\272\217\345\210\227\345\214\226\344\272\214\345\217\211\346\240\221.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 38. \345\255\227\347\254\246\344\270\262\347\232\204\346\216\222\345\210\227.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 39. \346\225\260\347\273\204\344\270\255\345\207\272\347\216\260\346\254\241\346\225\260\350\266\205\350\277\207\344\270\200\345\215\212\347\232\204\346\225\260\345\255\227.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 40. \346\234\200\345\260\217\347\232\204 k \344\270\252\346\225\260.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 41. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 42. \350\277\236\347\273\255\345\255\220\346\225\260\347\273\204\347\232\204\346\234\200\345\244\247\345\222\214.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 43. 1\357\275\236n \346\225\264\346\225\260\344\270\255 1 \345\207\272\347\216\260\347\232\204\346\254\241\346\225\260.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 44. \346\225\260\345\255\227\345\272\217\345\210\227\344\270\255\346\237\220\344\270\200\344\275\215\347\232\204\346\225\260\345\255\227.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 45. \346\212\212\346\225\260\347\273\204\346\216\222\346\210\220\346\234\200\345\260\217\347\232\204\346\225\260.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 46. \346\212\212\346\225\260\345\255\227\347\277\273\350\257\221\346\210\220\345\255\227\347\254\246\344\270\262.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 47. \347\244\274\347\211\251\347\232\204\346\234\200\345\244\247\344\273\267\345\200\274.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 48. \346\234\200\351\225\277\344\270\215\345\220\253\351\207\215\345\244\215\345\255\227\347\254\246\347\232\204\345\255\220\345\255\227\347\254\246\344\270\262.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 49. \344\270\221\346\225\260.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 50. \347\254\254\344\270\200\344\270\252\345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\345\255\227\347\254\246.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 51. \346\225\260\347\273\204\344\270\255\347\232\204\351\200\206\345\272\217\345\257\271.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 52. \344\270\244\344\270\252\351\223\276\350\241\250\347\232\204\347\254\254\344\270\200\344\270\252\345\205\254\345\205\261\350\212\202\347\202\271.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 53 - I. \345\234\250\346\216\222\345\272\217\346\225\260\347\273\204\344\270\255\346\237\245\346\211\276\346\225\260\345\255\227 I.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 53 - II. 0\357\275\236n-1 \344\270\255\347\274\272\345\244\261\347\232\204\346\225\260\345\255\227.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 54. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\347\254\254 k \345\244\247\350\212\202\347\202\271.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 55 - I. \344\272\214\345\217\211\346\240\221\347\232\204\346\267\261\345\272\246.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 55 - II. \345\271\263\350\241\241\344\272\214\345\217\211\346\240\221.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 56 - I. \346\225\260\347\273\204\344\270\255\346\225\260\345\255\227\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 56 - II. \346\225\260\347\273\204\344\270\255\346\225\260\345\255\227\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260 II.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 57 - II. \345\222\214\344\270\272 s \347\232\204\350\277\236\347\273\255\346\255\243\346\225\260\345\272\217\345\210\227.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 57. \345\222\214\344\270\272 s \347\232\204\344\270\244\344\270\252\346\225\260\345\255\227.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 58 - I. \347\277\273\350\275\254\345\215\225\350\257\215\351\241\272\345\272\217.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 58 - II. \345\267\246\346\227\213\350\275\254\345\255\227\347\254\246\344\270\262.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 59 - I. \346\273\221\345\212\250\347\252\227\345\217\243\347\232\204\346\234\200\345\244\247\345\200\274.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 59 - II. \351\230\237\345\210\227\347\232\204\346\234\200\345\244\247\345\200\274.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 60. n \344\270\252\351\252\260\345\255\220\347\232\204\347\202\271\346\225\260.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 61. \346\211\221\345\205\213\347\211\214\344\270\255\347\232\204\351\241\272\345\255\220.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 62. \345\234\206\345\234\210\344\270\255\346\234\200\345\220\216\345\211\251\344\270\213\347\232\204\346\225\260\345\255\227.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 63. \350\202\241\347\245\250\347\232\204\346\234\200\345\244\247\345\210\251\346\266\246.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 64. \346\261\202 1 + 2 + \342\200\246 + n.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 65. \344\270\215\347\224\250\345\212\240\345\207\217\344\271\230\351\231\244\345\201\232\345\212\240\346\263\225.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 66. \346\236\204\345\273\272\344\271\230\347\247\257\346\225\260\347\273\204.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 67. \346\212\212\345\255\227\347\254\246\344\270\262\350\275\254\346\215\242\346\210\220\346\225\264\346\225\260.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 68 - I. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\346\234\200\350\277\221\345\205\254\345\205\261\347\245\226\345\205\210.md"
create mode 100644 "sword_for_offer/docs/\345\211\221\346\214\207 Offer 68 - II. \344\272\214\345\217\211\346\240\221\347\232\204\346\234\200\350\277\221\345\205\254\345\205\261\347\245\226\345\205\210.md"
diff --git a/sword_for_offer/codes/cpp/include/ListNode.hpp b/sword_for_offer/codes/cpp/include/ListNode.hpp
index 4191649..fdb66f4 100644
--- a/sword_for_offer/codes/cpp/include/ListNode.hpp
+++ b/sword_for_offer/codes/cpp/include/ListNode.hpp
@@ -11,21 +11,22 @@ using namespace std;
/**
* @brief Definition for a singly-linked list node
- *
+ *
*/
struct ListNode {
int val;
ListNode *next;
- ListNode(int x) : val(x), next(nullptr) {}
+ ListNode(int x) : val(x), next(nullptr) {
+ }
};
/**
* @brief Generate a linked list with a vector
- *
- * @param list
- * @return ListNode*
+ *
+ * @param list
+ * @return ListNode*
*/
-ListNode* vectorToLinkedList(vector list) {
+ListNode *vectorToLinkedList(vector list) {
ListNode *dum = new ListNode(0);
ListNode *head = dum;
for (int val : list) {
@@ -37,12 +38,12 @@ ListNode* vectorToLinkedList(vector list) {
/**
* @brief Get a list node with specific value from a linked list
- *
- * @param head
- * @param val
- * @return ListNode*
+ *
+ * @param head
+ * @param val
+ * @return ListNode*
*/
-ListNode* getListNode(ListNode *head, int val) {
+ListNode *getListNode(ListNode *head, int val) {
while (head != nullptr && head->val != val) {
head = head->next;
}
diff --git a/sword_for_offer/codes/cpp/include/PrintUtil.hpp b/sword_for_offer/codes/cpp/include/PrintUtil.hpp
index 34e8b86..4bc89fb 100644
--- a/sword_for_offer/codes/cpp/include/PrintUtil.hpp
+++ b/sword_for_offer/codes/cpp/include/PrintUtil.hpp
@@ -6,192 +6,185 @@
#pragma once
-#include
-#include
-#include
#include "ListNode.hpp"
#include "TreeNode.hpp"
+#include
+#include
+#include
class PrintUtil {
- public:
- /**
- * @brief Find an element in a vector
- *
- * @tparam T
- * @param vec
- * @param ele
- * @return int
- */
- template
- static int vecFind(const vector& vec, T ele) {
- int j = INT_MAX;
- for (int i = 0; i < vec.size(); i++) {
- if (vec[i] == ele) {
- j = i;
- }
+ public:
+ /**
+ * @brief Find an element in a vector
+ *
+ * @tparam T
+ * @param vec
+ * @param ele
+ * @return int
+ */
+ template static int vecFind(const vector &vec, T ele) {
+ int j = INT_MAX;
+ for (int i = 0; i < vec.size(); i++) {
+ if (vec[i] == ele) {
+ j = i;
}
- return j;
}
+ return j;
+ }
- /**
- * @brief Concatenate a vector with a delim
- *
- * @tparam T
- * @param delim
- * @param vec
- * @return string
- */
- template
- static string strJoin(const string& delim, const T& vec) {
- ostringstream s;
- for (const auto& i : vec) {
- if (&i != &vec[0]) {
- s << delim;
- }
- s << i;
+ /**
+ * @brief Concatenate a vector with a delim
+ *
+ * @tparam T
+ * @param delim
+ * @param vec
+ * @return string
+ */
+ template static string strJoin(const string &delim, const T &vec) {
+ ostringstream s;
+ for (const auto &i : vec) {
+ if (&i != &vec[0]) {
+ s << delim;
}
- return s.str();
+ s << i;
}
+ return s.str();
+ }
- /**
- * @brief Repeat a string for n times
- *
- * @param str
- * @param n
- * @return string
- */
- static string strRepeat(string str, int n) {
- ostringstream os;
- for(int i = 0; i < n; i++)
- os << str;
- return os.str();
- }
+ /**
+ * @brief Repeat a string for n times
+ *
+ * @param str
+ * @param n
+ * @return string
+ */
+ static string strRepeat(string str, int n) {
+ ostringstream os;
+ for (int i = 0; i < n; i++)
+ os << str;
+ return os.str();
+ }
- /**
- * @brief Get the Vector String object
- *
- * @tparam T
- * @param list
- * @return string
- */
- template
- static string getVectorString(vector &list) {
- return "[" + strJoin(", ", list) + "]";
- }
+ /**
+ * @brief Get the Vector String object
+ *
+ * @tparam T
+ * @param list
+ * @return string
+ */
+ template static string getVectorString(vector &list) {
+ return "[" + strJoin(", ", list) + "]";
+ }
+
+ /**
+ * @brief Print a vector
+ *
+ * @tparam T
+ * @param list
+ */
+ template static void printVector(vector &list) {
+ cout << getVectorString(list) << '\n';
+ }
+
+ /**
+ * @brief Print a vector matrix
+ *
+ * @tparam T
+ * @param matrix
+ */
+ template static void printVectorMatrix(vector> &matrix) {
+ cout << "[" << '\n';
+ for (vector &list : matrix)
+ cout << " " + getVectorString(list) + "," << '\n';
+ cout << "]" << '\n';
+ }
- /**
- * @brief Print a vector
- *
- * @tparam T
- * @param list
- */
- template
- static void printVector(vector &list) {
- cout << getVectorString(list) << '\n';
+ /**
+ * @brief Print a linked list
+ *
+ * @param head
+ */
+ static void printLinkedList(ListNode *head) {
+ vector list;
+ while (head != nullptr) {
+ list.push_back(head->val);
+ head = head->next;
}
- /**
- * @brief Print a vector matrix
- *
- * @tparam T
- * @param matrix
- */
- template
- static void printVectorMatrix(vector> &matrix) {
- cout << "[" << '\n';
- for (vector &list : matrix)
- cout << " " + getVectorString(list) + "," << '\n';
- cout << "]" << '\n';
+ cout << strJoin(" -> ", list) << '\n';
+ }
+
+ /**
+ * @brief This tree printer is borrowed from TECHIE DELIGHT
+ * https://www.techiedelight.com/c-program-print-binary-tree/
+ */
+ struct Trunk {
+ Trunk *prev;
+ string str;
+ Trunk(Trunk *prev, string str) {
+ this->prev = prev;
+ this->str = str;
}
+ };
- /**
- * @brief Print a linked list
- *
- * @param head
- */
- static void printLinkedList(ListNode *head) {
- vector list;
- while (head != nullptr) {
- list.push_back(head->val);
- head = head->next;
- }
-
- cout << strJoin(" -> ", list) << '\n';
+ /**
+ * @brief Helper function to print branches of the binary tree
+ *
+ * @param p
+ */
+ static void showTrunks(Trunk *p) {
+ if (p == nullptr) {
+ return;
}
- /**
- * @brief This tree printer is borrowed from TECHIE DELIGHT
- * https://www.techiedelight.com/c-program-print-binary-tree/
- */
- struct Trunk {
- Trunk *prev;
- string str;
- Trunk(Trunk *prev, string str) {
- this->prev = prev;
- this->str = str;
- }
- };
-
- /**
- * @brief Helper function to print branches of the binary tree
- *
- * @param p
- */
- static void showTrunks(Trunk *p) {
- if (p == nullptr) {
- return;
- }
-
- showTrunks(p->prev);
- cout << p->str;
+ showTrunks(p->prev);
+ cout << p->str;
+ }
+
+ /**
+ * @brief The interface of the tree printer
+ *
+ * @param root
+ */
+ static void printTree(TreeNode *root) {
+ printTree(root, nullptr, false);
+ }
+
+ /**
+ * @brief Print a binary tree
+ *
+ * @param root
+ * @param prev
+ * @param isLeft
+ */
+ static void printTree(TreeNode *root, Trunk *prev, bool isLeft) {
+ if (root == nullptr) {
+ return;
}
- /**
- * @brief The interface of the tree printer
- *
- * @param root
- */
- static void printTree(TreeNode *root) {
- printTree(root, nullptr, false);
+ string prev_str = " ";
+ Trunk *trunk = new Trunk(prev, prev_str);
+
+ printTree(root->right, trunk, true);
+
+ if (!prev) {
+ trunk->str = "———";
+ } else if (isLeft) {
+ trunk->str = "/———";
+ prev_str = " |";
+ } else {
+ trunk->str = "\\———";
+ prev->str = prev_str;
}
- /**
- * @brief Print a binary tree
- *
- * @param root
- * @param prev
- * @param isLeft
- */
- static void printTree(TreeNode *root, Trunk *prev, bool isLeft) {
- if (root == nullptr) {
- return;
- }
-
- string prev_str = " ";
- Trunk *trunk = new Trunk(prev, prev_str);
-
- printTree(root->right, trunk, true);
-
- if (!prev) {
- trunk->str = "———";
- }
- else if (isLeft) {
- trunk->str = "/———";
- prev_str = " |";
- }
- else {
- trunk->str = "\\———";
- prev->str = prev_str;
- }
-
- showTrunks(trunk);
- cout << " " << root->val << endl;
-
- if (prev) {
- prev->str = prev_str;
- }
- trunk->str = " |";
-
- printTree(root->left, trunk, false);
+ showTrunks(trunk);
+ cout << " " << root->val << endl;
+
+ if (prev) {
+ prev->str = prev_str;
}
+ trunk->str = " |";
+
+ printTree(root->left, trunk, false);
+ }
};
diff --git a/sword_for_offer/codes/cpp/include/TreeNode.hpp b/sword_for_offer/codes/cpp/include/TreeNode.hpp
index a8e9d04..cab592b 100644
--- a/sword_for_offer/codes/cpp/include/TreeNode.hpp
+++ b/sword_for_offer/codes/cpp/include/TreeNode.hpp
@@ -8,35 +8,36 @@
/**
* @brief Definition for a binary tree node
- *
+ *
*/
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
- TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
+ TreeNode(int x) : val(x), left(nullptr), right(nullptr) {
+ }
};
/**
* @brief Generate a binary tree with a vector
- *
- * @param list
- * @return TreeNode*
+ *
+ * @param list
+ * @return TreeNode*
*/
-TreeNode* vectorToTree(vector list) {
+TreeNode *vectorToTree(vector list) {
TreeNode *root = new TreeNode(list[0]);
- queue que;
+ queue que;
que.emplace(root);
int i = 1;
- while(!que.empty()) {
+ while (!que.empty()) {
TreeNode *node = que.front();
que.pop();
- if(list[i] != INT_MAX) {
+ if (list[i] != INT_MAX) {
node->left = new TreeNode(list[i]);
que.emplace(node->left);
}
i++;
- if(list[i] != INT_MAX) {
+ if (list[i] != INT_MAX) {
node->right = new TreeNode(list[i]);
que.emplace(node->right);
}
@@ -47,12 +48,12 @@ TreeNode* vectorToTree(vector list) {
/**
* @brief Get a tree node with specific value in a binary tree
- *
- * @param root
- * @param val
- * @return TreeNode*
+ *
+ * @param root
+ * @param val
+ * @return TreeNode*
*/
-TreeNode* getTreeNode(TreeNode *root, int val) {
+TreeNode *getTreeNode(TreeNode *root, int val) {
if (root == nullptr)
return nullptr;
if (root->val == val)
diff --git a/sword_for_offer/codes/cpp/include/include.hpp b/sword_for_offer/codes/cpp/include/include.hpp
index 8e84583..5ca1e7b 100644
--- a/sword_for_offer/codes/cpp/include/include.hpp
+++ b/sword_for_offer/codes/cpp/include/include.hpp
@@ -6,18 +6,18 @@
#pragma once
+#include
#include
-#include
-#include
-#include
#include
-#include
+#include
+#include
+#include
#include
#include
-#include
+#include
#include "ListNode.hpp"
-#include "TreeNode.hpp"
#include "PrintUtil.hpp"
+#include "TreeNode.hpp"
using namespace std;
diff --git a/sword_for_offer/codes/cpp/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.cpp b/sword_for_offer/codes/cpp/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.cpp
index 7975201..4f56d52 100644
--- a/sword_for_offer/codes/cpp/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.cpp
+++ b/sword_for_offer/codes/cpp/sfo_03_find_duplicate_numbers_in_an_array_s2/sfo_03_find_duplicate_numbers_in_an_array_s2.cpp
@@ -1,24 +1,24 @@
/*
-* File: sfo_03_find_duplicate_numbers_in_an_array_s2.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_03_find_duplicate_numbers_in_an_array_s2.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- int findRepeatNumber(vector& nums) {
+ public:
+ int findRepeatNumber(vector &nums) {
int i = 0;
- while(i < nums.size()) {
- if(nums[i] == i) {
+ while (i < nums.size()) {
+ if (nums[i] == i) {
i++;
continue;
}
- if(nums[nums[i]] == nums[i])
+ if (nums[nums[i]] == nums[i])
return nums[i];
- swap(nums[i],nums[nums[i]]);
+ swap(nums[i], nums[nums[i]]);
}
return -1;
}
@@ -26,11 +26,11 @@ class Solution {
int main() {
// ======= Test Case =======
- vector nums = { 2, 3, 1, 0, 2, 5, 3 };
+ vector nums = {2, 3, 1, 0, 2, 5, 3};
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
int res = slt->findRepeatNumber(nums);
cout << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.cpp b/sword_for_offer/codes/cpp/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.cpp
index af7a76c..c329958 100644
--- a/sword_for_offer/codes/cpp/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_04_find_a_number_in_2d_matrix_s1/sfo_04_find_a_number_in_2d_matrix_s1.cpp
@@ -1,21 +1,23 @@
/*
-* File: sfo_04_find_a_number_in_2d_matrix_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_04_find_a_number_in_2d_matrix_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- bool findNumberIn2DArray(vector>& matrix, int target) {
+ public:
+ bool findNumberIn2DArray(vector> &matrix, int target) {
int i = matrix.size() - 1, j = 0;
- while(i >= 0 && j < matrix[0].size())
- {
- if(matrix[i][j] > target) i--;
- else if(matrix[i][j] < target) j++;
- else return true;
+ while (i >= 0 && j < matrix[0].size()) {
+ if (matrix[i][j] > target)
+ i--;
+ else if (matrix[i][j] < target)
+ j++;
+ else
+ return true;
}
return false;
}
@@ -24,17 +26,12 @@ class Solution {
int main() {
// ======= Test Case =======
vector> matrix = {
- { 1, 4, 7, 11, 15 },
- { 2, 5, 8, 12, 19 },
- { 3, 6, 9, 16, 22 },
- { 10, 13, 14, 17, 24 },
- { 18, 21, 23, 26, 30 }
-};
+ {1, 4, 7, 11, 15}, {2, 5, 8, 12, 19}, {3, 6, 9, 16, 22}, {10, 13, 14, 17, 24}, {18, 21, 23, 26, 30}};
int target = 5;
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
bool res = slt->findNumberIn2DArray(matrix, target);
cout << boolalpha << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.cpp b/sword_for_offer/codes/cpp/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.cpp
index 50cab0e..a467d7d 100644
--- a/sword_for_offer/codes/cpp/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_05_replace_spaces_s1/sfo_05_replace_spaces_s1.cpp
@@ -1,24 +1,25 @@
/*
-* File: sfo_05_replace_spaces_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_05_replace_spaces_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
+ public:
string replaceSpace(string s) {
int count = 0, len = s.size();
// 统计空格数量
for (char c : s) {
- if (c == ' ') count++;
+ if (c == ' ')
+ count++;
}
// 修改 s 长度
s.resize(len + 2 * count);
// 倒序遍历修改
- for(int i = len - 1, j = s.size() - 1; i < j; i--, j--) {
+ for (int i = len - 1, j = s.size() - 1; i < j; i--, j--) {
if (s[i] != ' ')
s[j] = s[i];
else {
@@ -36,9 +37,9 @@ int main() {
// ======= Test Case =======
string s = "We are happy.";
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
string res = slt->replaceSpace(s);
cout << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.cpp b/sword_for_offer/codes/cpp/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.cpp
index 903fcd0..1edbf2c 100644
--- a/sword_for_offer/codes/cpp/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_06_print_a_linked_list_in_reverse_order_s1/sfo_06_print_a_linked_list_in_reverse_order_s1.cpp
@@ -1,22 +1,24 @@
/*
-* File: sfo_06_print_a_linked_list_in_reverse_order_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_06_print_a_linked_list_in_reverse_order_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- vector reversePrint(ListNode* head) {
+ public:
+ vector reversePrint(ListNode *head) {
recur(head);
return res;
}
-private:
+
+ private:
vector res;
- void recur(ListNode* head) {
- if(head == nullptr) return;
+ void recur(ListNode *head) {
+ if (head == nullptr)
+ return;
recur(head->next);
res.push_back(head->val);
}
@@ -24,11 +26,11 @@ class Solution {
int main() {
// ======= Test Case =======
- ListNode* head = vectorToLinkedList(vector { 1, 3, 2 });
+ ListNode *head = vectorToLinkedList(vector{1, 3, 2});
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
vector res = slt->reversePrint(head);
PrintUtil::printVector(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.cpp b/sword_for_offer/codes/cpp/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.cpp
index 6e4cfce..ba69c3e 100644
--- a/sword_for_offer/codes/cpp/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.cpp
+++ b/sword_for_offer/codes/cpp/sfo_06_print_a_linked_list_in_reverse_order_s2/sfo_06_print_a_linked_list_in_reverse_order_s2.cpp
@@ -1,22 +1,22 @@
/*
-* File: sfo_06_print_a_linked_list_in_reverse_order_s2.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_06_print_a_linked_list_in_reverse_order_s2.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- vector reversePrint(ListNode* head) {
+ public:
+ vector reversePrint(ListNode *head) {
stack stk;
- while(head != nullptr) {
+ while (head != nullptr) {
stk.push(head->val);
head = head->next;
}
vector res;
- while(!stk.empty()) {
+ while (!stk.empty()) {
res.push_back(stk.top());
stk.pop();
}
@@ -26,11 +26,11 @@ class Solution {
int main() {
// ======= Test Case =======
- ListNode* head = vectorToLinkedList(vector { 1, 3, 2 });
+ ListNode *head = vectorToLinkedList(vector{1, 3, 2});
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
vector res = slt->reversePrint(head);
PrintUtil::printVector(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.cpp
index 4375d57..f795a67 100644
--- a/sword_for_offer/codes/cpp/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_07_reconstruct_binary_tree_s1/sfo_07_reconstruct_binary_tree_s1.cpp
@@ -1,26 +1,28 @@
/*
-* File: sfo_07_reconstruct_binary_tree_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_07_reconstruct_binary_tree_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- TreeNode* buildTree(vector& preorder, vector& inorder) {
+ public:
+ TreeNode *buildTree(vector &preorder, vector &inorder) {
this->preorder = preorder;
- for(int i = 0; i < inorder.size(); i++)
+ for (int i = 0; i < inorder.size(); i++)
dic[inorder[i]] = i;
return recur(0, 0, inorder.size() - 1);
}
-private:
+
+ private:
vector preorder;
unordered_map dic;
- TreeNode* recur(int root, int left, int right) {
- if(left > right) return nullptr; // 递归终止
- TreeNode* node = new TreeNode(preorder[root]); // 建立根节点
+ TreeNode *recur(int root, int left, int right) {
+ if (left > right)
+ return nullptr; // 递归终止
+ TreeNode *node = new TreeNode(preorder[root]); // 建立根节点
int i = dic[preorder[root]]; // 划分根节点、左子树、右子树
node->left = recur(root + 1, left, i - 1); // 开启左子树递归
node->right = recur(root + i - left + 1, i + 1, right); // 开启右子树递归
@@ -30,12 +32,12 @@ class Solution {
int main() {
// ======= Test Case =======
- vector preorder = { 3, 9, 20, 15, 7 };
- vector inorder = { 9, 3, 15, 20, 7 };
+ vector preorder = {3, 9, 20, 15, 7};
+ vector inorder = {9, 3, 15, 20, 7};
// ====== Driver Code ======
- Solution* slt = new Solution();
- TreeNode* res = slt->buildTree(preorder, inorder);
+ Solution *slt = new Solution();
+ TreeNode *res = slt->buildTree(preorder, inorder);
PrintUtil::printTree(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.cpp b/sword_for_offer/codes/cpp/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.cpp
index 4c7da99..3b1f923 100644
--- a/sword_for_offer/codes/cpp/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_09_implement_a_queue_using_two_stacks_s1/sfo_09_implement_a_queue_using_two_stacks_s1.cpp
@@ -1,27 +1,29 @@
/*
-* File: sfo_09_implement_a_queue_using_two_stacks_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_09_implement_a_queue_using_two_stacks_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class CQueue {
-public:
+ public:
stack A, B;
- CQueue() {}
+ CQueue() {
+ }
void appendTail(int value) {
A.push(value);
}
int deleteHead() {
- if(!B.empty()) {
+ if (!B.empty()) {
int tmp = B.top();
B.pop();
return tmp;
}
- if(A.empty()) return -1;
- while(!A.empty()) {
+ if (A.empty())
+ return -1;
+ while (!A.empty()) {
int tmp = A.top();
A.pop();
B.push(tmp);
@@ -35,7 +37,7 @@ class CQueue {
int main() {
// ====== Driver Code ======
vector res;
- CQueue* cQueue = new CQueue();
+ CQueue *cQueue = new CQueue();
res.push_back(cQueue->deleteHead());
cQueue->appendTail(5);
cQueue->appendTail(2);
diff --git a/sword_for_offer/codes/cpp/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.cpp b/sword_for_offer/codes/cpp/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.cpp
index c8bcb4e..33d67c5 100644
--- a/sword_for_offer/codes/cpp/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_10i_fibonacci_numbers_s1/sfo_10i_fibonacci_numbers_s1.cpp
@@ -1,17 +1,17 @@
/*
-* File: sfo_10i_fibonacci_numbers_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_10i_fibonacci_numbers_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
+ public:
int fib(int n) {
int a = 0, b = 1, sum;
- for(int i = 0; i < n; i++){
+ for (int i = 0; i < n; i++) {
sum = (a + b) % 1000000007;
a = b;
b = sum;
@@ -24,9 +24,9 @@ int main() {
// ======= Test Case =======
int n = 5;
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
int res = slt->fib(n);
cout << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.cpp b/sword_for_offer/codes/cpp/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.cpp
index edee18d..919174b 100644
--- a/sword_for_offer/codes/cpp/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_10ii_frog_jump_s1/sfo_10ii_frog_jump_s1.cpp
@@ -1,17 +1,17 @@
/*
-* File: sfo_10ii_frog_jump_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_10ii_frog_jump_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
+ public:
int numWays(int n) {
int a = 1, b = 1, sum;
- for(int i = 0; i < n; i++){
+ for (int i = 0; i < n; i++) {
sum = (a + b) % 1000000007;
a = b;
b = sum;
@@ -24,9 +24,9 @@ int main() {
// ======= Test Case =======
int n = 7;
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
int res = slt->numWays(n);
cout << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.cpp b/sword_for_offer/codes/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.cpp
index b23919d..87c6f6a 100644
--- a/sword_for_offer/codes/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s1/sfo_11_find_minimum_in_rotated_sorted_array_s1.cpp
@@ -1,21 +1,24 @@
/*
-* File: sfo_11_find_minimum_in_rotated_sorted_array_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_11_find_minimum_in_rotated_sorted_array_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- int minArray(vector& numbers) {
+ public:
+ int minArray(vector &numbers) {
int i = 0, j = numbers.size() - 1;
while (i < j) {
int m = (i + j) / 2;
- if (numbers[m] > numbers[j]) i = m + 1;
- else if (numbers[m] < numbers[j]) j = m;
- else j--;
+ if (numbers[m] > numbers[j])
+ i = m + 1;
+ else if (numbers[m] < numbers[j])
+ j = m;
+ else
+ j--;
}
return numbers[i];
}
@@ -23,11 +26,11 @@ class Solution {
int main() {
// ======= Test Case =======
- vector numbers = { 3, 4, 5, 1, 2 };
+ vector numbers = {3, 4, 5, 1, 2};
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
int res = slt->minArray(numbers);
cout << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.cpp b/sword_for_offer/codes/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.cpp
index a910d92..88a2679 100644
--- a/sword_for_offer/codes/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.cpp
+++ b/sword_for_offer/codes/cpp/sfo_11_find_minimum_in_rotated_sorted_array_s2/sfo_11_find_minimum_in_rotated_sorted_array_s2.cpp
@@ -1,24 +1,27 @@
/*
-* File: sfo_11_find_minimum_in_rotated_sorted_array_s2.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_11_find_minimum_in_rotated_sorted_array_s2.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- int minArray(vector& numbers) {
+ public:
+ int minArray(vector &numbers) {
int i = 0, j = numbers.size() - 1;
while (i < j) {
int m = (i + j) / 2;
- if (numbers[m] > numbers[j]) i = m + 1;
- else if (numbers[m] < numbers[j]) j = m;
+ if (numbers[m] > numbers[j])
+ i = m + 1;
+ else if (numbers[m] < numbers[j])
+ j = m;
else {
int x = i;
- for(int k = i + 1; k < j; k++) {
- if(numbers[k] < numbers[x]) x = k;
+ for (int k = i + 1; k < j; k++) {
+ if (numbers[k] < numbers[x])
+ x = k;
}
return numbers[x];
}
@@ -29,11 +32,11 @@ class Solution {
int main() {
// ======= Test Case =======
- vector numbers = { 3, 4, 5, 1, 2 };
+ vector numbers = {3, 4, 5, 1, 2};
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
int res = slt->minArray(numbers);
cout << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_12_word_search_s1/sfo_12_word_search_s1.cpp b/sword_for_offer/codes/cpp/sfo_12_word_search_s1/sfo_12_word_search_s1.cpp
index 2018e0e..c299d5d 100644
--- a/sword_for_offer/codes/cpp/sfo_12_word_search_s1/sfo_12_word_search_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_12_word_search_s1/sfo_12_word_search_s1.cpp
@@ -1,32 +1,36 @@
/*
-* File: sfo_12_word_search_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_12_word_search_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- bool exist(vector>& board, string word) {
+ public:
+ bool exist(vector> &board, string word) {
rows = board.size();
cols = board[0].size();
- for(int i = 0; i < rows; i++) {
- for(int j = 0; j < cols; j++) {
- if(dfs(board, word, i, j, 0)) return true;
+ for (int i = 0; i < rows; i++) {
+ for (int j = 0; j < cols; j++) {
+ if (dfs(board, word, i, j, 0))
+ return true;
}
}
return false;
}
-private:
+
+ private:
int rows, cols;
- bool dfs(vector>& board, string word, int i, int j, int k) {
- if(i >= rows || i < 0 || j >= cols || j < 0 || board[i][j] != word[k]) return false;
- if(k == word.size() - 1) return true;
+ bool dfs(vector> &board, string word, int i, int j, int k) {
+ if (i >= rows || i < 0 || j >= cols || j < 0 || board[i][j] != word[k])
+ return false;
+ if (k == word.size() - 1)
+ return true;
board[i][j] = '\0';
- bool res = dfs(board, word, i + 1, j, k + 1) || dfs(board, word, i - 1, j, k + 1) ||
- dfs(board, word, i, j + 1, k + 1) || dfs(board, word, i , j - 1, k + 1);
+ bool res = dfs(board, word, i + 1, j, k + 1) || dfs(board, word, i - 1, j, k + 1) ||
+ dfs(board, word, i, j + 1, k + 1) || dfs(board, word, i, j - 1, k + 1);
board[i][j] = word[k];
return res;
}
@@ -34,16 +38,12 @@ class Solution {
int main() {
// ======= Test Case =======
- vector> board = {
- { 'A', 'B', 'C', 'E' },
- { 'S', 'F', 'C', 'S' },
- { 'A', 'D', 'E', 'E' }
-};
+ vector> board = {{'A', 'B', 'C', 'E'}, {'S', 'F', 'C', 'S'}, {'A', 'D', 'E', 'E'}};
string word = "ABCCED";
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
bool res = slt->exist(board, word);
cout << boolalpha << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.cpp b/sword_for_offer/codes/cpp/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.cpp
index 85ff655..49e6353 100644
--- a/sword_for_offer/codes/cpp/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_13_range_of_motion_of_a_robot_s1/sfo_13_range_of_motion_of_a_robot_s1.cpp
@@ -1,24 +1,26 @@
/*
-* File: sfo_13_range_of_motion_of_a_robot_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_13_range_of_motion_of_a_robot_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
+ public:
int movingCount(int m, int n, int k) {
vector> visited(m, vector(n, 0));
return dfs(0, 0, 0, 0, visited, m, n, k);
}
-private:
+
+ private:
int dfs(int i, int j, int si, int sj, vector> &visited, int m, int n, int k) {
- if(i >= m || j >= n || k < si + sj || visited[i][j]) return 0;
+ if (i >= m || j >= n || k < si + sj || visited[i][j])
+ return 0;
visited[i][j] = true;
return 1 + dfs(i + 1, j, (i + 1) % 10 != 0 ? si + 1 : si - 8, sj, visited, m, n, k) +
- dfs(i, j + 1, si, (j + 1) % 10 != 0 ? sj + 1 : sj - 8, visited, m, n, k);
+ dfs(i, j + 1, si, (j + 1) % 10 != 0 ? sj + 1 : sj - 8, visited, m, n, k);
}
};
@@ -28,9 +30,9 @@ int main() {
int n = 3;
int k = 1;
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
int res = slt->movingCount(m, n, k);
cout << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.cpp b/sword_for_offer/codes/cpp/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.cpp
index 32fb20a..330cc26 100644
--- a/sword_for_offer/codes/cpp/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.cpp
+++ b/sword_for_offer/codes/cpp/sfo_13_range_of_motion_of_a_robot_s2/sfo_13_range_of_motion_of_a_robot_s2.cpp
@@ -1,28 +1,29 @@
/*
-* File: sfo_13_range_of_motion_of_a_robot_s2.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_13_range_of_motion_of_a_robot_s2.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
+ public:
int movingCount(int m, int n, int k) {
vector> visited(m, vector(n, 0));
int res = 0;
queue> que;
- que.push({ 0, 0, 0, 0 });
- while(que.size() > 0) {
+ que.push({0, 0, 0, 0});
+ while (que.size() > 0) {
vector x = que.front();
que.pop();
int i = x[0], j = x[1], si = x[2], sj = x[3];
- if(i >= m || j >= n || k < si + sj || visited[i][j]) continue;
+ if (i >= m || j >= n || k < si + sj || visited[i][j])
+ continue;
visited[i][j] = true;
res++;
- que.push({ i + 1, j, (i + 1) % 10 != 0 ? si + 1 : si - 8, sj });
- que.push({ i, j + 1, si, (j + 1) % 10 != 0 ? sj + 1 : sj - 8 });
+ que.push({i + 1, j, (i + 1) % 10 != 0 ? si + 1 : si - 8, sj});
+ que.push({i, j + 1, si, (j + 1) % 10 != 0 ? sj + 1 : sj - 8});
}
return res;
}
@@ -34,9 +35,9 @@ int main() {
int n = 3;
int k = 1;
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
int res = slt->movingCount(m, n, k);
cout << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.cpp b/sword_for_offer/codes/cpp/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.cpp
index 5c235ee..da0b46e 100644
--- a/sword_for_offer/codes/cpp/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_14i_cut_the_rope_i_s1/sfo_14i_cut_the_rope_i_s1.cpp
@@ -1,19 +1,22 @@
/*
-* File: sfo_14i_cut_the_rope_i_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_14i_cut_the_rope_i_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
+ public:
int cuttingRope(int n) {
- if(n <= 3) return n - 1;
+ if (n <= 3)
+ return n - 1;
int a = n / 3, b = n % 3;
- if(b == 0) return pow(3, a);
- if(b == 1) return pow(3, a - 1) * 4;
+ if (b == 0)
+ return pow(3, a);
+ if (b == 1)
+ return pow(3, a - 1) * 4;
return pow(3, a) * 2;
}
};
@@ -22,9 +25,9 @@ int main() {
// ======= Test Case =======
int n = 10;
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
int res = slt->cuttingRope(n);
cout << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.cpp b/sword_for_offer/codes/cpp/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.cpp
index b9cc1ec..2581ffe 100644
--- a/sword_for_offer/codes/cpp/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_14ii_cut_the_rope_ii_s1/sfo_14ii_cut_the_rope_ii_s1.cpp
@@ -1,24 +1,28 @@
/*
-* File: sfo_14ii_cut_the_rope_ii_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_14ii_cut_the_rope_ii_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
+ public:
int cuttingRope(int n) {
- if(n <= 3) return n - 1;
+ if (n <= 3)
+ return n - 1;
int b = n % 3, p = 1000000007;
long rem = 1, x = 3;
- for(int a = n / 3 - 1; a > 0; a /= 2) {
- if(a % 2 == 1) rem = (rem * x) % p;
+ for (int a = n / 3 - 1; a > 0; a /= 2) {
+ if (a % 2 == 1)
+ rem = (rem * x) % p;
x = (x * x) % p;
}
- if(b == 0) return (int)(rem * 3 % p);
- if(b == 1) return (int)(rem * 4 % p);
+ if (b == 0)
+ return (int)(rem * 3 % p);
+ if (b == 1)
+ return (int)(rem * 4 % p);
return (int)(rem * 6 % p);
}
};
@@ -27,9 +31,9 @@ int main() {
// ======= Test Case =======
int n = 10;
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
int res = slt->cuttingRope(n);
cout << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.cpp b/sword_for_offer/codes/cpp/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.cpp
index dc8439c..7d7206d 100644
--- a/sword_for_offer/codes/cpp/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_15_number_of_1_bits_s1/sfo_15_number_of_1_bits_s1.cpp
@@ -1,17 +1,17 @@
/*
-* File: sfo_15_number_of_1_bits_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_15_number_of_1_bits_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
+ public:
int hammingWeight(uint32_t n) {
unsigned int res = 0; // c++ 使用无符号数
- while(n != 0) {
+ while (n != 0) {
res += n & 1;
n >>= 1;
}
@@ -23,9 +23,9 @@ int main() {
// ======= Test Case =======
uint32_t n = 11;
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
int res = slt->hammingWeight(n);
cout << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.cpp b/sword_for_offer/codes/cpp/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.cpp
index 8b7d8a9..8d4f2d1 100644
--- a/sword_for_offer/codes/cpp/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.cpp
+++ b/sword_for_offer/codes/cpp/sfo_15_number_of_1_bits_s2/sfo_15_number_of_1_bits_s2.cpp
@@ -1,17 +1,17 @@
/*
-* File: sfo_15_number_of_1_bits_s2.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_15_number_of_1_bits_s2.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
+ public:
int hammingWeight(uint32_t n) {
int res = 0;
- while(n != 0) {
+ while (n != 0) {
res++;
n &= n - 1;
}
@@ -23,9 +23,9 @@ int main() {
// ======= Test Case =======
uint32_t n = 11;
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
int res = slt->hammingWeight(n);
cout << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.cpp b/sword_for_offer/codes/cpp/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.cpp
index c8e0edb..16f47c6 100644
--- a/sword_for_offer/codes/cpp/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_16_powers_of_integers_s1/sfo_16_powers_of_integers_s1.cpp
@@ -1,24 +1,26 @@
/*
-* File: sfo_16_powers_of_integers_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_16_powers_of_integers_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
+ public:
double myPow(double x, int n) {
- if(x == 0.0f) return 0.0;
+ if (x == 0.0f)
+ return 0.0;
long b = n;
double res = 1.0;
- if(b < 0) {
+ if (b < 0) {
x = 1 / x;
b = -b;
}
- while(b > 0) {
- if((b & 1) == 1) res *= x;
+ while (b > 0) {
+ if ((b & 1) == 1)
+ res *= x;
x *= x;
b >>= 1;
}
@@ -31,9 +33,9 @@ int main() {
double x = 2.0;
int n = 10;
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
double res = slt->myPow(x, n);
cout << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.cpp b/sword_for_offer/codes/cpp/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.cpp
index 37dbc00..7591fce 100644
--- a/sword_for_offer/codes/cpp/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_18_delete_a_node_from_a_linked_list_s1/sfo_18_delete_a_node_from_a_linked_list_s1.cpp
@@ -1,34 +1,36 @@
/*
-* File: sfo_18_delete_a_node_from_a_linked_list_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_18_delete_a_node_from_a_linked_list_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- ListNode* deleteNode(ListNode* head, int val) {
- if(head->val == val) return head->next;
+ public:
+ ListNode *deleteNode(ListNode *head, int val) {
+ if (head->val == val)
+ return head->next;
ListNode *pre = head, *cur = head->next;
- while(cur != nullptr && cur->val != val) {
+ while (cur != nullptr && cur->val != val) {
pre = cur;
cur = cur->next;
}
- if(cur != nullptr) pre->next = cur->next;
+ if (cur != nullptr)
+ pre->next = cur->next;
return head;
}
};
int main() {
// ======= Test Case =======
- ListNode* head = vectorToLinkedList(vector { 4, 5, 1, 9 });
+ ListNode *head = vectorToLinkedList(vector{4, 5, 1, 9});
int val = 5;
// ====== Driver Code ======
- Solution* slt = new Solution();
- ListNode* res = slt->deleteNode(head, val);
+ Solution *slt = new Solution();
+ ListNode *res = slt->deleteNode(head, val);
PrintUtil::printLinkedList(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.cpp b/sword_for_offer/codes/cpp/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.cpp
index f8c9aaa..31e8727 100644
--- a/sword_for_offer/codes/cpp/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_19_regular_expression_matching_s1/sfo_19_regular_expression_matching_s1.cpp
@@ -1,25 +1,24 @@
/*
-* File: sfo_19_regular_expression_matching_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_19_regular_expression_matching_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
+ public:
bool isMatch(string s, string p) {
int m = s.size() + 1, n = p.size() + 1;
vector> dp(m, vector(n, false));
dp[0][0] = true;
- for(int j = 2; j < n; j += 2)
+ for (int j = 2; j < n; j += 2)
dp[0][j] = dp[0][j - 2] && p[j - 1] == '*';
- for(int i = 1; i < m; i++) {
- for(int j = 1; j < n; j++) {
- dp[i][j] = p[j - 1] == '*' ?
- dp[i][j - 2] || dp[i - 1][j] && (s[i - 1] == p[j - 2] || p[j - 2] == '.'):
- dp[i - 1][j - 1] && (p[j - 1] == '.' || s[i - 1] == p[j - 1]);
+ for (int i = 1; i < m; i++) {
+ for (int j = 1; j < n; j++) {
+ dp[i][j] = p[j - 1] == '*' ? dp[i][j - 2] || dp[i - 1][j] && (s[i - 1] == p[j - 2] || p[j - 2] == '.')
+ : dp[i - 1][j - 1] && (p[j - 1] == '.' || s[i - 1] == p[j - 1]);
}
}
return dp[m - 1][n - 1];
@@ -31,9 +30,9 @@ int main() {
string s = "mississippi";
string p = "mis*is*p*.";
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
bool res = slt->isMatch(s, p);
cout << boolalpha << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.cpp b/sword_for_offer/codes/cpp/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.cpp
index abad706..da3fea2 100644
--- a/sword_for_offer/codes/cpp/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.cpp
+++ b/sword_for_offer/codes/cpp/sfo_19_regular_expression_matching_s2/sfo_19_regular_expression_matching_s2.cpp
@@ -1,31 +1,36 @@
/*
-* File: sfo_19_regular_expression_matching_s2.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_19_regular_expression_matching_s2.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
+ public:
bool isMatch(string s, string p) {
int m = s.size() + 1, n = p.size() + 1;
vector> dp(m, vector(n, false));
dp[0][0] = true;
// 初始化首行
- for(int j = 2; j < n; j += 2)
+ for (int j = 2; j < n; j += 2)
dp[0][j] = dp[0][j - 2] && p[j - 1] == '*';
// 状态转移
- for(int i = 1; i < m; i++) {
- for(int j = 1; j < n; j++) {
- if(p[j - 1] == '*') {
- if(dp[i][j - 2]) dp[i][j] = true; // 1.
- else if(dp[i - 1][j] && s[i - 1] == p[j - 2]) dp[i][j] = true; // 2.
- else if(dp[i - 1][j] && p[j - 2] == '.') dp[i][j] = true; // 3.
+ for (int i = 1; i < m; i++) {
+ for (int j = 1; j < n; j++) {
+ if (p[j - 1] == '*') {
+ if (dp[i][j - 2])
+ dp[i][j] = true; // 1.
+ else if (dp[i - 1][j] && s[i - 1] == p[j - 2])
+ dp[i][j] = true; // 2.
+ else if (dp[i - 1][j] && p[j - 2] == '.')
+ dp[i][j] = true; // 3.
} else {
- if(dp[i - 1][j - 1] && s[i - 1] == p[j - 1]) dp[i][j] = true; // 1.
- else if(dp[i - 1][j - 1] && p[j - 1] == '.') dp[i][j] = true; // 2.
+ if (dp[i - 1][j - 1] && s[i - 1] == p[j - 1])
+ dp[i][j] = true; // 1.
+ else if (dp[i - 1][j - 1] && p[j - 1] == '.')
+ dp[i][j] = true; // 2.
}
}
}
@@ -38,9 +43,9 @@ int main() {
string s = "mississippi";
string p = "mis*is*p*.";
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
bool res = slt->isMatch(s, p);
cout << boolalpha << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.cpp b/sword_for_offer/codes/cpp/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.cpp
index cc74780..433b940 100644
--- a/sword_for_offer/codes/cpp/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_21_adjust_the_order_of_numbers_in_an_array_s1/sfo_21_adjust_the_order_of_numbers_in_an_array_s1.cpp
@@ -1,20 +1,21 @@
/*
-* File: sfo_21_adjust_the_order_of_numbers_in_an_array_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_21_adjust_the_order_of_numbers_in_an_array_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- vector exchange(vector& nums) {
+ public:
+ vector exchange(vector &nums) {
int i = 0, j = nums.size() - 1;
- while (i < j)
- {
- while(i < j && (nums[i] & 1) == 1) i++;
- while(i < j && (nums[j] & 1) == 0) j--;
+ while (i < j) {
+ while (i < j && (nums[i] & 1) == 1)
+ i++;
+ while (i < j && (nums[j] & 1) == 0)
+ j--;
swap(nums[i], nums[j]);
}
return nums;
@@ -23,11 +24,11 @@ class Solution {
int main() {
// ======= Test Case =======
- vector nums = { 1, 2, 3, 4 };
+ vector nums = {1, 2, 3, 4};
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
vector res = slt->exchange(nums);
PrintUtil::printVector(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.cpp b/sword_for_offer/codes/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.cpp
index 8e54ec8..8b383e2 100644
--- a/sword_for_offer/codes/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.cpp
@@ -1,19 +1,19 @@
/*
-* File: sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_22_the_kth_node_from_the_end_of_a_linked_list_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- ListNode* getKthFromEnd(ListNode* head, int k) {
+ public:
+ ListNode *getKthFromEnd(ListNode *head, int k) {
ListNode *former = head, *latter = head;
- for(int i = 0; i < k; i++)
+ for (int i = 0; i < k; i++)
former = former->next;
- while(former != nullptr) {
+ while (former != nullptr) {
former = former->next;
latter = latter->next;
}
@@ -23,12 +23,12 @@ class Solution {
int main() {
// ======= Test Case =======
- ListNode* head = vectorToLinkedList(vector { 1, 2, 3, 4, 5 });
+ ListNode *head = vectorToLinkedList(vector{1, 2, 3, 4, 5});
int k = 2;
// ====== Driver Code ======
- Solution* slt = new Solution();
- ListNode* res = slt->getKthFromEnd(head, k);
+ Solution *slt = new Solution();
+ ListNode *res = slt->getKthFromEnd(head, k);
PrintUtil::printLinkedList(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.cpp b/sword_for_offer/codes/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.cpp
index 1c80e0d..1556e95 100644
--- a/sword_for_offer/codes/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.cpp
+++ b/sword_for_offer/codes/cpp/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2/sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.cpp
@@ -1,21 +1,22 @@
/*
-* File: sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_22_the_kth_node_from_the_end_of_a_linked_list_s2.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- ListNode* getKthFromEnd(ListNode* head, int k) {
+ public:
+ ListNode *getKthFromEnd(ListNode *head, int k) {
ListNode *former = head, *latter = head;
- for(int i = 0; i < k; i++) {
- if(former == nullptr) return nullptr;
+ for (int i = 0; i < k; i++) {
+ if (former == nullptr)
+ return nullptr;
former = former->next;
}
- while(former != nullptr) {
+ while (former != nullptr) {
former = former->next;
latter = latter->next;
}
@@ -25,12 +26,12 @@ class Solution {
int main() {
// ======= Test Case =======
- ListNode* head = vectorToLinkedList(vector { 1, 2, 3, 4, 5 });
+ ListNode *head = vectorToLinkedList(vector{1, 2, 3, 4, 5});
int k = 2;
// ====== Driver Code ======
- Solution* slt = new Solution();
- ListNode* res = slt->getKthFromEnd(head, k);
+ Solution *slt = new Solution();
+ ListNode *res = slt->getKthFromEnd(head, k);
PrintUtil::printLinkedList(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.cpp b/sword_for_offer/codes/cpp/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.cpp
index 24a0c66..f876eea 100644
--- a/sword_for_offer/codes/cpp/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_24_reverse_a_linked_list_s1/sfo_24_reverse_a_linked_list_s1.cpp
@@ -1,18 +1,18 @@
/*
-* File: sfo_24_reverse_a_linked_list_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_24_reverse_a_linked_list_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- ListNode* reverseList(ListNode* head) {
+ public:
+ ListNode *reverseList(ListNode *head) {
ListNode *cur = head, *pre = nullptr;
- while(cur != nullptr) {
- ListNode* tmp = cur->next; // 暂存后继节点 cur.next
+ while (cur != nullptr) {
+ ListNode *tmp = cur->next; // 暂存后继节点 cur.next
cur->next = pre; // 修改 next 引用指向
pre = cur; // pre 暂存 cur
cur = tmp; // cur 访问下一节点
@@ -23,11 +23,11 @@ class Solution {
int main() {
// ======= Test Case =======
- ListNode* head = vectorToLinkedList(vector { 1, 2, 3, 4, 5 });
+ ListNode *head = vectorToLinkedList(vector{1, 2, 3, 4, 5});
// ====== Driver Code ======
- Solution* slt = new Solution();
- ListNode* res = slt->reverseList(head);
+ Solution *slt = new Solution();
+ ListNode *res = slt->reverseList(head);
PrintUtil::printLinkedList(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.cpp b/sword_for_offer/codes/cpp/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.cpp
index 2ec993e..241d131 100644
--- a/sword_for_offer/codes/cpp/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.cpp
+++ b/sword_for_offer/codes/cpp/sfo_24_reverse_a_linked_list_s2/sfo_24_reverse_a_linked_list_s2.cpp
@@ -1,21 +1,23 @@
/*
-* File: sfo_24_reverse_a_linked_list_s2.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_24_reverse_a_linked_list_s2.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- ListNode* reverseList(ListNode* head) {
- return recur(head, nullptr); // 调用递归并返回
+ public:
+ ListNode *reverseList(ListNode *head) {
+ return recur(head, nullptr); // 调用递归并返回
}
-private:
- ListNode* recur(ListNode* cur, ListNode* pre) {
- if (cur == nullptr) return pre; // 终止条件
- ListNode* res = recur(cur->next, cur); // 递归后继节点
+
+ private:
+ ListNode *recur(ListNode *cur, ListNode *pre) {
+ if (cur == nullptr)
+ return pre; // 终止条件
+ ListNode *res = recur(cur->next, cur); // 递归后继节点
cur->next = pre; // 修改节点引用指向
return res; // 返回反转链表的头节点
}
@@ -23,11 +25,11 @@ class Solution {
int main() {
// ======= Test Case =======
- ListNode* head = vectorToLinkedList(vector { 1, 2, 3, 4, 5 });
+ ListNode *head = vectorToLinkedList(vector{1, 2, 3, 4, 5});
// ====== Driver Code ======
- Solution* slt = new Solution();
- ListNode* res = slt->reverseList(head);
+ Solution *slt = new Solution();
+ ListNode *res = slt->reverseList(head);
PrintUtil::printLinkedList(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.cpp b/sword_for_offer/codes/cpp/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.cpp
index 5ca2443..0ef5b1f 100644
--- a/sword_for_offer/codes/cpp/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_25_combine_two_sorted_linked_lists_s1/sfo_25_combine_two_sorted_linked_lists_s1.cpp
@@ -1,23 +1,22 @@
/*
-* File: sfo_25_combine_two_sorted_linked_lists_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_25_combine_two_sorted_linked_lists_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
- ListNode* dum = new ListNode(0);
- ListNode* cur = dum;
- while(l1 != nullptr && l2 != nullptr) {
- if(l1->val < l2->val) {
+ public:
+ ListNode *mergeTwoLists(ListNode *l1, ListNode *l2) {
+ ListNode *dum = new ListNode(0);
+ ListNode *cur = dum;
+ while (l1 != nullptr && l2 != nullptr) {
+ if (l1->val < l2->val) {
cur->next = l1;
l1 = l1->next;
- }
- else {
+ } else {
cur->next = l2;
l2 = l2->next;
}
@@ -30,12 +29,12 @@ class Solution {
int main() {
// ======= Test Case =======
- ListNode* l1 = vectorToLinkedList(vector { 1, 2, 4 });
- ListNode* l2 = vectorToLinkedList(vector { 1, 3, 4 });
+ ListNode *l1 = vectorToLinkedList(vector{1, 2, 4});
+ ListNode *l2 = vectorToLinkedList(vector{1, 3, 4});
// ====== Driver Code ======
- Solution* slt = new Solution();
- ListNode* res = slt->mergeTwoLists(l1, l2);
+ Solution *slt = new Solution();
+ ListNode *res = slt->mergeTwoLists(l1, l2);
PrintUtil::printLinkedList(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.cpp
index 9714f94..6bc1386 100644
--- a/sword_for_offer/codes/cpp/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_26_substructure_of_a_binary_tree_s1/sfo_26_substructure_of_a_binary_tree_s1.cpp
@@ -1,33 +1,37 @@
/*
-* File: sfo_26_substructure_of_a_binary_tree_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_26_substructure_of_a_binary_tree_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- bool isSubStructure(TreeNode* A, TreeNode* B) {
- return (A != nullptr && B != nullptr) && (recur(A, B) || isSubStructure(A->left, B) || isSubStructure(A->right, B));
+ public:
+ bool isSubStructure(TreeNode *A, TreeNode *B) {
+ return (A != nullptr && B != nullptr) &&
+ (recur(A, B) || isSubStructure(A->left, B) || isSubStructure(A->right, B));
}
-private:
- bool recur(TreeNode* A, TreeNode* B) {
- if(B == nullptr) return true;
- if(A == nullptr || A->val != B->val) return false;
+
+ private:
+ bool recur(TreeNode *A, TreeNode *B) {
+ if (B == nullptr)
+ return true;
+ if (A == nullptr || A->val != B->val)
+ return false;
return recur(A->left, B->left) && recur(A->right, B->right);
}
};
int main() {
// ======= Test Case =======
- TreeNode* A = vectorToTree(vector { 3, 4, 5, 1, 2, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX });
- TreeNode* B = vectorToTree(vector { 4, 1, INT_MAX, INT_MAX, INT_MAX });
+ TreeNode *A = vectorToTree(vector{3, 4, 5, 1, 2, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX});
+ TreeNode *B = vectorToTree(vector{4, 1, INT_MAX, INT_MAX, INT_MAX});
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
bool res = slt->isSubStructure(A, B);
cout << boolalpha << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.cpp
index 700f2cd..2dc872b 100644
--- a/sword_for_offer/codes/cpp/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_27_mirror_of_a_binary_tree_s1/sfo_27_mirror_of_a_binary_tree_s1.cpp
@@ -1,17 +1,18 @@
/*
-* File: sfo_27_mirror_of_a_binary_tree_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_27_mirror_of_a_binary_tree_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- TreeNode* mirrorTree(TreeNode* root) {
- if (root == nullptr) return nullptr;
- TreeNode* tmp = root->left;
+ public:
+ TreeNode *mirrorTree(TreeNode *root) {
+ if (root == nullptr)
+ return nullptr;
+ TreeNode *tmp = root->left;
root->left = mirrorTree(root->right);
root->right = mirrorTree(tmp);
return root;
@@ -20,11 +21,12 @@ class Solution {
int main() {
// ======= Test Case =======
- TreeNode* root = vectorToTree(vector { 4, 2, 7, 1, 3, 6, 9, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX });
+ TreeNode *root = vectorToTree(
+ vector{4, 2, 7, 1, 3, 6, 9, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX});
// ====== Driver Code ======
- Solution* slt = new Solution();
- TreeNode* res = slt->mirrorTree(root);
+ Solution *slt = new Solution();
+ TreeNode *res = slt->mirrorTree(root);
PrintUtil::printTree(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.cpp b/sword_for_offer/codes/cpp/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.cpp
index a406e23..34b2df8 100644
--- a/sword_for_offer/codes/cpp/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.cpp
+++ b/sword_for_offer/codes/cpp/sfo_27_mirror_of_a_binary_tree_s2/sfo_27_mirror_of_a_binary_tree_s2.cpp
@@ -1,25 +1,27 @@
/*
-* File: sfo_27_mirror_of_a_binary_tree_s2.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_27_mirror_of_a_binary_tree_s2.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- TreeNode* mirrorTree(TreeNode* root) {
- if(root == nullptr) return nullptr;
- stack stack;
+ public:
+ TreeNode *mirrorTree(TreeNode *root) {
+ if (root == nullptr)
+ return nullptr;
+ stack stack;
stack.push(root);
- while (!stack.empty())
- {
- TreeNode* node = stack.top();
+ while (!stack.empty()) {
+ TreeNode *node = stack.top();
stack.pop();
- if (node->left != nullptr) stack.push(node->left);
- if (node->right != nullptr) stack.push(node->right);
- TreeNode* tmp = node->left;
+ if (node->left != nullptr)
+ stack.push(node->left);
+ if (node->right != nullptr)
+ stack.push(node->right);
+ TreeNode *tmp = node->left;
node->left = node->right;
node->right = tmp;
}
@@ -29,11 +31,12 @@ class Solution {
int main() {
// ======= Test Case =======
- TreeNode* root = vectorToTree(vector { 4, 2, 7, 1, 3, 6, 9, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX });
+ TreeNode *root = vectorToTree(
+ vector{4, 2, 7, 1, 3, 6, 9, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX});
// ====== Driver Code ======
- Solution* slt = new Solution();
- TreeNode* res = slt->mirrorTree(root);
+ Solution *slt = new Solution();
+ TreeNode *res = slt->mirrorTree(root);
PrintUtil::printTree(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.cpp
index a893e2a..ba835b3 100644
--- a/sword_for_offer/codes/cpp/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_28_symmetric_binary_tree_s1/sfo_28_symmetric_binary_tree_s1.cpp
@@ -1,32 +1,36 @@
/*
-* File: sfo_28_symmetric_binary_tree_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_28_symmetric_binary_tree_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- bool isSymmetric(TreeNode* root) {
+ public:
+ bool isSymmetric(TreeNode *root) {
return root == nullptr || recur(root->left, root->right);
}
-private:
- bool recur(TreeNode* L, TreeNode* R) {
- if(L == nullptr && R == nullptr) return true;
- if(L == nullptr || R == nullptr || L->val != R->val) return false;
+
+ private:
+ bool recur(TreeNode *L, TreeNode *R) {
+ if (L == nullptr && R == nullptr)
+ return true;
+ if (L == nullptr || R == nullptr || L->val != R->val)
+ return false;
return recur(L->left, R->right) && recur(L->right, R->left);
}
};
int main() {
// ======= Test Case =======
- TreeNode* root = vectorToTree(vector { 1, 2, 2, 3, 4, 4, 3, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX });
+ TreeNode *root = vectorToTree(
+ vector{1, 2, 2, 3, 4, 4, 3, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX});
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
bool res = slt->isSymmetric(root);
cout << boolalpha << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.cpp b/sword_for_offer/codes/cpp/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.cpp
index d4d303b..aa507f4 100644
--- a/sword_for_offer/codes/cpp/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_29_print_a_given_matrix_in_spiral_form_s1/sfo_29_print_a_given_matrix_in_spiral_form_s1.cpp
@@ -1,28 +1,36 @@
/*
-* File: sfo_29_print_a_given_matrix_in_spiral_form_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_29_print_a_given_matrix_in_spiral_form_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- vector spiralOrder(vector>& matrix) {
- if (matrix.empty()) return {};
+ public:
+ vector spiralOrder(vector> &matrix) {
+ if (matrix.empty())
+ return {};
int l = 0, r = matrix[0].size() - 1, t = 0, b = matrix.size() - 1;
vector res;
- while(true)
- {
- for (int i = l; i <= r; i++) res.push_back(matrix[t][i]); // left to right
- if (++t > b) break;
- for (int i = t; i <= b; i++) res.push_back(matrix[i][r]); // top to bottom
- if (l > --r) break;
- for (int i = r; i >= l; i--) res.push_back(matrix[b][i]); // right to left
- if (t > --b) break;
- for (int i = b; i >= t; i--) res.push_back(matrix[i][l]); // bottom to top
- if (++l > r) break;
+ while (true) {
+ for (int i = l; i <= r; i++)
+ res.push_back(matrix[t][i]); // left to right
+ if (++t > b)
+ break;
+ for (int i = t; i <= b; i++)
+ res.push_back(matrix[i][r]); // top to bottom
+ if (l > --r)
+ break;
+ for (int i = r; i >= l; i--)
+ res.push_back(matrix[b][i]); // right to left
+ if (t > --b)
+ break;
+ for (int i = b; i >= t; i--)
+ res.push_back(matrix[i][l]); // bottom to top
+ if (++l > r)
+ break;
}
return res;
}
@@ -30,15 +38,11 @@ class Solution {
int main() {
// ======= Test Case =======
- vector> matrix = {
- { 1, 2, 3 },
- { 4, 5, 6 },
- { 7, 8, 9 }
-};
+ vector> matrix = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
vector res = slt->spiralOrder(matrix);
PrintUtil::printVector(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_30_min_stack_s1/sfo_30_min_stack_s1.cpp b/sword_for_offer/codes/cpp/sfo_30_min_stack_s1/sfo_30_min_stack_s1.cpp
index 05ae45d..1dfd9e9 100644
--- a/sword_for_offer/codes/cpp/sfo_30_min_stack_s1/sfo_30_min_stack_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_30_min_stack_s1/sfo_30_min_stack_s1.cpp
@@ -1,23 +1,24 @@
/*
-* File: sfo_30_min_stack_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_30_min_stack_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class MinStack {
-public:
+ public:
stack A, B;
- MinStack() {}
+ MinStack() {
+ }
void push(int x) {
A.push(x);
- if(B.empty() || B.top() >= x)
+ if (B.empty() || B.top() >= x)
B.push(x);
}
void pop() {
- if(A.top() == B.top())
+ if (A.top() == B.top())
B.pop();
A.pop();
}
@@ -32,7 +33,7 @@ class MinStack {
int main() {
// ====== Driver Code ======
vector res;
- MinStack* minStack = new MinStack();
+ MinStack *minStack = new MinStack();
minStack->push(-2);
minStack->push(0);
minStack->push(-3);
diff --git a/sword_for_offer/codes/cpp/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.cpp b/sword_for_offer/codes/cpp/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.cpp
index aaf210b..9d9868c 100644
--- a/sword_for_offer/codes/cpp/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_31_validate_stack_sequences_s1/sfo_31_validate_stack_sequences_s1.cpp
@@ -1,20 +1,20 @@
/*
-* File: sfo_31_validate_stack_sequences_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_31_validate_stack_sequences_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- bool validateStackSequences(vector& pushed, vector& popped) {
+ public:
+ bool validateStackSequences(vector &pushed, vector &popped) {
stack stk;
int i = 0;
- for(int num : pushed) {
- stk.push(num); // num 入栈
- while(!stk.empty() && stk.top() == popped[i]) { // 循环判断与出栈
+ for (int num : pushed) {
+ stk.push(num); // num 入栈
+ while (!stk.empty() && stk.top() == popped[i]) { // 循环判断与出栈
stk.pop();
i++;
}
@@ -25,12 +25,12 @@ class Solution {
int main() {
// ======= Test Case =======
- vector pushed = { 1, 2, 3, 4, 5 };
- vector popped = { 4, 5, 3, 2, 1 };
+ vector pushed = {1, 2, 3, 4, 5};
+ vector popped = {4, 5, 3, 2, 1};
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
bool res = slt->validateStackSequences(pushed, popped);
cout << boolalpha << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.cpp b/sword_for_offer/codes/cpp/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.cpp
index e7ebcd1..41bc6ab 100644
--- a/sword_for_offer/codes/cpp/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_32i_print_a_binary_tree_topbottom_i_s1/sfo_32i_print_a_binary_tree_topbottom_i_s1.cpp
@@ -1,25 +1,28 @@
/*
-* File: sfo_32i_print_a_binary_tree_topbottom_i_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_32i_print_a_binary_tree_topbottom_i_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- vector levelOrder(TreeNode* root) {
+ public:
+ vector levelOrder(TreeNode *root) {
vector res;
- if(!root) return res;
- queue que;
+ if (!root)
+ return res;
+ queue que;
que.push(root);
- while(!que.empty()){
- TreeNode* node = que.front();
+ while (!que.empty()) {
+ TreeNode *node = que.front();
que.pop();
res.push_back(node->val);
- if(node->left) que.push(node->left);
- if(node->right) que.push(node->right);
+ if (node->left)
+ que.push(node->left);
+ if (node->right)
+ que.push(node->right);
}
return res;
}
@@ -27,11 +30,11 @@ class Solution {
int main() {
// ======= Test Case =======
- TreeNode* root = vectorToTree(vector { 3, 9, 20, INT_MAX, INT_MAX, 15, 7, INT_MAX, INT_MAX, INT_MAX, INT_MAX });
+ TreeNode *root = vectorToTree(vector{3, 9, 20, INT_MAX, INT_MAX, 15, 7, INT_MAX, INT_MAX, INT_MAX, INT_MAX});
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
vector res = slt->levelOrder(root);
PrintUtil::printVector(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.cpp b/sword_for_offer/codes/cpp/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.cpp
index 98e77e6..12349f9 100644
--- a/sword_for_offer/codes/cpp/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_32ii_print_a_binary_tree_topbottom_ii_s1/sfo_32ii_print_a_binary_tree_topbottom_ii_s1.cpp
@@ -1,27 +1,30 @@
/*
-* File: sfo_32ii_print_a_binary_tree_topbottom_ii_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_32ii_print_a_binary_tree_topbottom_ii_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- vector> levelOrder(TreeNode* root) {
- queue que;
+ public:
+ vector> levelOrder(TreeNode *root) {
+ queue que;
vector> res;
int cnt = 0;
- if(root != NULL) que.push(root);
- while(!que.empty()) {
+ if (root != NULL)
+ que.push(root);
+ while (!que.empty()) {
vector tmp;
- for(int i = que.size(); i > 0; --i) {
+ for (int i = que.size(); i > 0; --i) {
root = que.front();
que.pop();
tmp.push_back(root->val);
- if(root->left != NULL) que.push(root->left);
- if(root->right != NULL) que.push(root->right);
+ if (root->left != NULL)
+ que.push(root->left);
+ if (root->right != NULL)
+ que.push(root->right);
}
res.push_back(tmp);
}
@@ -31,11 +34,11 @@ class Solution {
int main() {
// ======= Test Case =======
- TreeNode* root = vectorToTree(vector { 3, 9, 20, INT_MAX, INT_MAX, 15, 7, INT_MAX, INT_MAX, INT_MAX, INT_MAX });
+ TreeNode *root = vectorToTree(vector{3, 9, 20, INT_MAX, INT_MAX, 15, 7, INT_MAX, INT_MAX, INT_MAX, INT_MAX});
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
vector> res = slt->levelOrder(root);
PrintUtil::printVectorMatrix(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.cpp b/sword_for_offer/codes/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.cpp
index 1d90ac8..382aa03 100644
--- a/sword_for_offer/codes/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s1/sfo_32iii_print_a_binary_tree_topbottom_iii_s1.cpp
@@ -1,42 +1,48 @@
/*
-* File: sfo_32iii_print_a_binary_tree_topbottom_iii_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_32iii_print_a_binary_tree_topbottom_iii_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- vector> levelOrder(TreeNode* root) {
- deque deque;
+ public:
+ vector> levelOrder(TreeNode *root) {
+ deque deque;
vector> res;
- if(root != NULL) deque.push_back(root);
- while(!deque.empty()) {
+ if (root != NULL)
+ deque.push_back(root);
+ while (!deque.empty()) {
// 打印奇数层
vector tmp;
- for(int i = deque.size(); i > 0; i--) {
+ for (int i = deque.size(); i > 0; i--) {
// 从左向右打印
- TreeNode* node = deque.front();
+ TreeNode *node = deque.front();
deque.pop_front();
tmp.push_back(node->val);
// 先左后右加入下层节点
- if(node->left != NULL) deque.push_back(node->left);
- if(node->right != NULL) deque.push_back(node->right);
+ if (node->left != NULL)
+ deque.push_back(node->left);
+ if (node->right != NULL)
+ deque.push_back(node->right);
}
res.push_back(tmp);
- if(deque.empty()) break; // 若为空则提前跳出
+ if (deque.empty())
+ break; // 若为空则提前跳出
// 打印偶数层
tmp.clear();
- for(int i = deque.size(); i > 0; i--) {
+ for (int i = deque.size(); i > 0; i--) {
// 从右向左打印
- TreeNode* node = deque.back();
+ TreeNode *node = deque.back();
deque.pop_back();
tmp.push_back(node->val);
// 先右后左加入下层节点
- if(node->right != NULL) deque.push_front(node->right);
- if(node->left != NULL) deque.push_front(node->left);
+ if (node->right != NULL)
+ deque.push_front(node->right);
+ if (node->left != NULL)
+ deque.push_front(node->left);
}
res.push_back(tmp);
}
@@ -46,11 +52,11 @@ class Solution {
int main() {
// ======= Test Case =======
- TreeNode* root = vectorToTree(vector { 3, 9, 20, INT_MAX, INT_MAX, 15, 7, INT_MAX, INT_MAX, INT_MAX, INT_MAX });
+ TreeNode *root = vectorToTree(vector{3, 9, 20, INT_MAX, INT_MAX, 15, 7, INT_MAX, INT_MAX, INT_MAX, INT_MAX});
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
vector> res = slt->levelOrder(root);
PrintUtil::printVectorMatrix(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.cpp b/sword_for_offer/codes/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.cpp
index 660d0e9..db14771 100644
--- a/sword_for_offer/codes/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.cpp
+++ b/sword_for_offer/codes/cpp/sfo_32iii_print_a_binary_tree_topbottom_iii_s2/sfo_32iii_print_a_binary_tree_topbottom_iii_s2.cpp
@@ -1,28 +1,32 @@
/*
-* File: sfo_32iii_print_a_binary_tree_topbottom_iii_s2.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_32iii_print_a_binary_tree_topbottom_iii_s2.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- vector> levelOrder(TreeNode* root) {
- queue que;
+ public:
+ vector> levelOrder(TreeNode *root) {
+ queue que;
vector> res;
- if(root != NULL) que.push(root);
- while(!que.empty()) {
+ if (root != NULL)
+ que.push(root);
+ while (!que.empty()) {
vector tmp;
- for(int i = que.size(); i > 0; i--) {
- TreeNode* node = que.front();
+ for (int i = que.size(); i > 0; i--) {
+ TreeNode *node = que.front();
que.pop();
tmp.push_back(node->val);
- if(node->left != NULL) que.push(node->left);
- if(node->right != NULL) que.push(node->right);
+ if (node->left != NULL)
+ que.push(node->left);
+ if (node->right != NULL)
+ que.push(node->right);
}
- if(res.size() % 2 == 1) reverse(tmp.begin(),tmp.end());
+ if (res.size() % 2 == 1)
+ reverse(tmp.begin(), tmp.end());
res.push_back(tmp);
}
return res;
@@ -31,11 +35,11 @@ class Solution {
int main() {
// ======= Test Case =======
- TreeNode* root = vectorToTree(vector { 3, 9, 20, INT_MAX, INT_MAX, 15, 7, INT_MAX, INT_MAX, INT_MAX, INT_MAX });
+ TreeNode *root = vectorToTree(vector{3, 9, 20, INT_MAX, INT_MAX, 15, 7, INT_MAX, INT_MAX, INT_MAX, INT_MAX});
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
vector> res = slt->levelOrder(root);
PrintUtil::printVectorMatrix(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.cpp
index 8f159e0..e708a45 100644
--- a/sword_for_offer/codes/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s1/sfo_33_postorder_traversal_of_a_binary_search_tree_s1.cpp
@@ -1,35 +1,39 @@
/*
-* File: sfo_33_postorder_traversal_of_a_binary_search_tree_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_33_postorder_traversal_of_a_binary_search_tree_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- bool verifyPostorder(vector& postorder) {
+ public:
+ bool verifyPostorder(vector &postorder) {
return recur(postorder, 0, postorder.size() - 1);
}
-private:
- bool recur(vector& postorder, int i, int j) {
- if(i >= j) return true;
+
+ private:
+ bool recur(vector &postorder, int i, int j) {
+ if (i >= j)
+ return true;
int p = i;
- while(postorder[p] < postorder[j]) p++;
+ while (postorder[p] < postorder[j])
+ p++;
int m = p;
- while(postorder[p] > postorder[j]) p++;
+ while (postorder[p] > postorder[j])
+ p++;
return p == j && recur(postorder, i, m - 1) && recur(postorder, m, j - 1);
}
};
int main() {
// ======= Test Case =======
- vector postorder = { 1, 6, 3, 2, 5 };
+ vector postorder = {1, 6, 3, 2, 5};
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
bool res = slt->verifyPostorder(postorder);
cout << boolalpha << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.cpp b/sword_for_offer/codes/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.cpp
index 1e128b7..7636485 100644
--- a/sword_for_offer/codes/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.cpp
+++ b/sword_for_offer/codes/cpp/sfo_33_postorder_traversal_of_a_binary_search_tree_s2/sfo_33_postorder_traversal_of_a_binary_search_tree_s2.cpp
@@ -1,20 +1,21 @@
/*
-* File: sfo_33_postorder_traversal_of_a_binary_search_tree_s2.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_33_postorder_traversal_of_a_binary_search_tree_s2.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- bool verifyPostorder(vector& postorder) {
+ public:
+ bool verifyPostorder(vector &postorder) {
stack stk;
int root = INT_MAX;
- for(int i = postorder.size() - 1; i >= 0; i--) {
- if(postorder[i] > root) return false;
- while(!stk.empty() && stk.top() > postorder[i]) {
+ for (int i = postorder.size() - 1; i >= 0; i--) {
+ if (postorder[i] > root)
+ return false;
+ while (!stk.empty() && stk.top() > postorder[i]) {
root = stk.top();
stk.pop();
}
@@ -26,11 +27,11 @@ class Solution {
int main() {
// ======= Test Case =======
- vector postorder = { 1, 6, 3, 2, 5 };
+ vector postorder = {1, 6, 3, 2, 5};
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
bool res = slt->verifyPostorder(postorder);
cout << boolalpha << res << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.cpp
index 301b13e..7632a34 100644
--- a/sword_for_offer/codes/cpp/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_34_all_xsum_paths_in_a_binary_tree_s1/sfo_34_all_xsum_paths_in_a_binary_tree_s1.cpp
@@ -1,26 +1,28 @@
/*
-* File: sfo_34_all_xsum_paths_in_a_binary_tree_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_34_all_xsum_paths_in_a_binary_tree_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
- vector> pathSum(TreeNode* root, int sum) {
+ public:
+ vector> pathSum(TreeNode *root, int sum) {
recur(root, sum);
return res;
}
-private:
+
+ private:
vector> res;
vector path;
- void recur(TreeNode* root, int tar) {
- if(root == nullptr) return;
+ void recur(TreeNode *root, int tar) {
+ if (root == nullptr)
+ return;
path.push_back(root->val);
tar -= root->val;
- if(tar == 0 && root->left == nullptr && root->right == nullptr)
+ if (tar == 0 && root->left == nullptr && root->right == nullptr)
res.push_back(path);
recur(root->left, tar);
recur(root->right, tar);
@@ -30,12 +32,14 @@ class Solution {
int main() {
// ======= Test Case =======
- TreeNode* root = vectorToTree(vector { 5, 4, 8, 11, INT_MAX, 13, 4, 7, 2, INT_MAX, INT_MAX, 5, 1, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX });
+ TreeNode *root =
+ vectorToTree(vector{5, 4, 8, 11, INT_MAX, 13, 4, 7, 2, INT_MAX, INT_MAX,
+ 5, 1, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX});
int sum = 22;
// ====== Driver Code ======
- Solution* slt = new Solution();
+ Solution *slt = new Solution();
vector> res = slt->pathSum(root, sum);
PrintUtil::printVectorMatrix(res);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.cpp b/sword_for_offer/codes/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.cpp
index 41b199b..80cf965 100644
--- a/sword_for_offer/codes/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.cpp
@@ -1,8 +1,8 @@
/*
-* File: sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_35_clone_a_linked_list_with_next_and_random_pointer_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
@@ -13,24 +13,26 @@ struct Node {
int val;
Node *next;
Node *random;
- Node(int x) : val(x), next(nullptr), random(nullptr) {}
+ Node(int x) : val(x), next(nullptr), random(nullptr) {
+ }
};
// ===== Solution Code =====
class Solution {
-public:
- Node* copyRandomList(Node* head) {
- if(head == nullptr) return nullptr;
- Node* cur = head;
- unordered_map map;
+ public:
+ Node *copyRandomList(Node *head) {
+ if (head == nullptr)
+ return nullptr;
+ Node *cur = head;
+ unordered_map map;
// 3. 复制各节点,并建立 “原节点 -> 新节点” 的 Map 映射
- while(cur != nullptr) {
+ while (cur != nullptr) {
map[cur] = new Node(cur->val);
cur = cur->next;
}
cur = head;
// 4. 构建新链表的 next 和 random 指向
- while(cur != nullptr) {
+ while (cur != nullptr) {
map[cur]->next = map[cur->next];
map[cur]->random = map[cur->random];
cur = cur->next;
@@ -42,10 +44,10 @@ class Solution {
int main() {
// ======= Test Case =======
- vector nodesVal { 7, 13, 11, 10, 1 };
- vector nodesRandom { INT_MAX, 0, 4, 2, 0 }; // Represent the 'null' Node with 'INT_MAX'
+ vector nodesVal{7, 13, 11, 10, 1};
+ vector nodesRandom{INT_MAX, 0, 4, 2, 0}; // Represent the 'null' Node with 'INT_MAX'
// Construct nodes
- vector nodeList;
+ vector nodeList;
for (int val : nodesVal) {
nodeList.push_back(new Node(val));
}
@@ -59,24 +61,24 @@ int main() {
nodeList[i]->random = nodeList[nodesRandom[i]];
}
// Get the head of the linked list
- Node* head = nodeList[0];
+ Node *head = nodeList[0];
// ====== Driver Code ======
- Solution* slt = new Solution();
- Node* res = slt->copyRandomList(head);
+ Solution *slt = new Solution();
+ Node *res = slt->copyRandomList(head);
// Print the copied linked list
- vector nodeListNew;
+ vector nodeListNew;
while (res != nullptr) {
nodeListNew.push_back(res);
res = res->next;
}
- vector> printArr(nodeListNew.size(), vector (2));
+ vector> printArr(nodeListNew.size(), vector(2));
for (int i = 0; i < nodeListNew.size(); i++) {
- Node* node = nodeListNew[i];
+ Node *node = nodeListNew[i];
printArr[i][0] = node->val;
printArr[i][1] = PrintUtil::vecFind(nodeListNew, node->random);
}
PrintUtil::printVectorMatrix(printArr);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.cpp b/sword_for_offer/codes/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.cpp
index d56c2f0..b176760 100644
--- a/sword_for_offer/codes/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.cpp
+++ b/sword_for_offer/codes/cpp/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.cpp
@@ -1,8 +1,8 @@
/*
-* File: sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
@@ -13,49 +13,51 @@ struct Node {
int val;
Node *next;
Node *random;
- Node(int x) : val(x), next(nullptr), random(nullptr) {}
+ Node(int x) : val(x), next(nullptr), random(nullptr) {
+ }
};
// ===== Solution Code =====
class Solution {
-public:
- Node* copyRandomList(Node* head) {
- if(head == nullptr) return nullptr;
- Node* cur = head;
+ public:
+ Node *copyRandomList(Node *head) {
+ if (head == nullptr)
+ return nullptr;
+ Node *cur = head;
// 1. 复制各节点,并构建拼接链表
- while(cur != nullptr) {
- Node* tmp = new Node(cur->val);
+ while (cur != nullptr) {
+ Node *tmp = new Node(cur->val);
tmp->next = cur->next;
cur->next = tmp;
cur = tmp->next;
}
// 2. 构建各新节点的 random 指向
cur = head;
- while(cur != nullptr) {
- if(cur->random != nullptr)
+ while (cur != nullptr) {
+ if (cur->random != nullptr)
cur->next->random = cur->random->next;
cur = cur->next->next;
}
// 3. 拆分两链表
cur = head->next;
- Node* pre = head, *res = head->next;
- while(cur->next != nullptr) {
+ Node *pre = head, *res = head->next;
+ while (cur->next != nullptr) {
pre->next = pre->next->next;
cur->next = cur->next->next;
pre = pre->next;
cur = cur->next;
}
pre->next = nullptr; // 单独处理原链表尾节点
- return res; // 返回新链表头节点
+ return res; // 返回新链表头节点
}
};
int main() {
// ======= Test Case =======
- vector nodesVal { 7, 13, 11, 10, 1 };
- vector nodesRandom { INT_MAX, 0, 4, 2, 0 }; // Represent the 'null' Node with 'INT_MAX'
+ vector nodesVal{7, 13, 11, 10, 1};
+ vector nodesRandom{INT_MAX, 0, 4, 2, 0}; // Represent the 'null' Node with 'INT_MAX'
// Construct nodes
- vector nodeList;
+ vector nodeList;
for (int val : nodesVal) {
nodeList.push_back(new Node(val));
}
@@ -69,24 +71,24 @@ int main() {
nodeList[i]->random = nodeList[nodesRandom[i]];
}
// Get the head of the linked list
- Node* head = nodeList[0];
+ Node *head = nodeList[0];
// ====== Driver Code ======
- Solution* slt = new Solution();
- Node* res = slt->copyRandomList(head);
+ Solution *slt = new Solution();
+ Node *res = slt->copyRandomList(head);
// Print the copied linked list
- vector nodeListNew;
+ vector nodeListNew;
while (res != nullptr) {
nodeListNew.push_back(res);
res = res->next;
}
- vector> printArr(nodeListNew.size(), vector (2));
+ vector> printArr(nodeListNew.size(), vector(2));
for (int i = 0; i < nodeListNew.size(); i++) {
- Node* node = nodeListNew[i];
+ Node *node = nodeListNew[i];
printArr[i][0] = node->val;
printArr[i][1] = PrintUtil::vecFind(nodeListNew, node->random);
}
PrintUtil::printVectorMatrix(printArr);
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.cpp b/sword_for_offer/codes/cpp/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.cpp
index 43f354e..f8712e4 100644
--- a/sword_for_offer/codes/cpp/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.cpp
@@ -1,8 +1,8 @@
/*
-* File: sfo_36_binary_search_tree_and_doubly_linked_list_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_36_binary_search_tree_and_doubly_linked_list_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
@@ -13,26 +13,32 @@ struct Node {
int val;
Node *left;
Node *right;
- Node(int x) : val(x), left(nullptr), right(nullptr) {}
+ Node(int x) : val(x), left(nullptr), right(nullptr) {
+ }
};
// ===== Solution Code =====
class Solution {
-public:
- Node* treeToDoublyList(Node* root) {
- if(root == nullptr) return nullptr;
+ public:
+ Node *treeToDoublyList(Node *root) {
+ if (root == nullptr)
+ return nullptr;
dfs(root);
head->left = pre;
pre->right = head;
return head;
}
-private:
+
+ private:
Node *pre, *head;
- void dfs(Node* cur) {
- if(cur == nullptr) return;
+ void dfs(Node *cur) {
+ if (cur == nullptr)
+ return;
dfs(cur->left);
- if(pre != nullptr) pre->right = cur;
- else head = cur;
+ if (pre != nullptr)
+ pre->right = cur;
+ else
+ head = cur;
cur->left = pre;
pre = cur;
dfs(cur->right);
@@ -41,22 +47,16 @@ class Solution {
int main() {
// ======= Test Case =======
- vector nodeList = {
- new Node(1),
- new Node(2),
- new Node(3),
- new Node(4),
- new Node(5)
- };
+ vector nodeList = {new Node(1), new Node(2), new Node(3), new Node(4), new Node(5)};
nodeList[3]->left = nodeList[1];
nodeList[3]->right = nodeList[4];
nodeList[1]->left = nodeList[0];
nodeList[1]->right = nodeList[2];
- Node* root = nodeList[3];
+ Node *root = nodeList[3];
// ====== Driver Code ======
- Solution* slt = new Solution();
- Node* res = slt->treeToDoublyList(root);
+ Solution *slt = new Solution();
+ Node *res = slt->treeToDoublyList(root);
// Print the Doubly circular linked list
vector nodesVal;
for (int i = 0; i <= nodeList.size(); i++) {
@@ -64,6 +64,6 @@ int main() {
res = res->right;
}
cout << PrintUtil::strJoin(" <-> ", nodesVal) << endl;
-
+
return 0;
}
diff --git a/sword_for_offer/codes/cpp/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.cpp b/sword_for_offer/codes/cpp/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.cpp
index d7677e9..d5d7578 100644
--- a/sword_for_offer/codes/cpp/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_37_serialize_and_deserialize_a_binary_tree_s1/sfo_37_serialize_and_deserialize_a_binary_tree_s1.cpp
@@ -1,28 +1,29 @@
/*
-* File: sfo_37_serialize_and_deserialize_a_binary_tree_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_37_serialize_and_deserialize_a_binary_tree_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
class Codec {
-public:
+ public:
// Encodes a tree to a single string.
- string serialize(TreeNode* root) {
- if(root == nullptr) return "[]";
+ string serialize(TreeNode *root) {
+ if (root == nullptr)
+ return "[]";
string res = "[";
- queue que;
+ queue que;
que.emplace(root);
- while(!que.empty()) {
- TreeNode* node = que.front();
+ while (!que.empty()) {
+ TreeNode *node = que.front();
que.pop();
- if(node != nullptr) {
+ if (node != nullptr) {
res += (to_string(node->val) + ",");
que.emplace(node->left);
que.emplace(node->right);
- }
- else res += "null,";
+ } else
+ res += "null,";
}
res.pop_back();
res += "]";
@@ -30,21 +31,21 @@ class Codec {
}
// Decodes your encoded data to tree.
- TreeNode* deserialize(string data) {
+ TreeNode *deserialize(string data) {
vector list = split(data.substr(1, data.length() - 2), ",");
TreeNode *root = new TreeNode(std::stoi(list[0]));
- queue que;
+ queue que;
que.emplace(root);
int i = 1;
- while(!que.empty()) {
+ while (!que.empty()) {
TreeNode *node = que.front();
que.pop();
- if(list[i] != "null") {
+ if (list[i] != "null") {
node->left = new TreeNode(std::stoi(list[i]));
que.emplace(node->left);
}
i++;
- if(list[i] != "null") {
+ if (list[i] != "null") {
node->right = new TreeNode(std::stoi(list[i]));
que.emplace(node->right);
}
@@ -53,7 +54,7 @@ class Codec {
return root;
}
-private:
+ private:
// Split a str by a delim
vector split(string str, string delim) {
vector list;
@@ -72,8 +73,8 @@ int main() {
// ======= Test Case =======
string data = "[1,2,3,null,null,4,5,null,null,null,null]";
// ====== Driver Code ======
- Codec* codec = new Codec();
- TreeNode* root = codec->deserialize(data);
+ Codec *codec = new Codec();
+ TreeNode *root = codec->deserialize(data);
string res = codec->serialize(root);
PrintUtil::printTree(root);
cout << res << endl;
diff --git a/sword_for_offer/codes/cpp/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.cpp b/sword_for_offer/codes/cpp/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.cpp
index 6ab23af..2c3c7c7 100644
--- a/sword_for_offer/codes/cpp/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.cpp
+++ b/sword_for_offer/codes/cpp/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.cpp
@@ -1,32 +1,34 @@
/*
-* File: sfo_38_all_permutations_of_a_string_s1.cpp
-* Created Time: 2021-12-09
-* Author: Krahets (krahets@163.com)
-*/
+ * File: sfo_38_all_permutations_of_a_string_s1.cpp
+ * Created Time: 2021-12-09
+ * Author: Krahets (krahets@163.com)
+ */
#include "../include/include.hpp"
// ===== Solution Code =====
class Solution {
-public:
+ public:
vector permutation(string s) {
dfs(s, 0);
return res;
}
-private:
+
+ private:
vector res;
void dfs(string s, int x) {
- if(x == s.size() - 1) {
- res.push_back(s); // 添加排列方案
+ if (x == s.size() - 1) {
+ res.push_back(s); // 添加排列方案
return;
}
set