Getting Started with Python Data Analysis and Practice

<section>课程地址 http://icourse8.com/Python3rumenyushizhan.html </section>

Section Detail
structures Chapter 1 Experiment Environment
Chapter 2 Numpy Getting Started
Chapter 3 Getting Pandas
Chapter. 4 Pandas Fun data
Chapter 5 Drawing and visualization of Matplotlib
Chapter 6 Drawing and visualization of Seaborn
Section 7. Data analysis project combat
of Chapter 8 Lessons Learned

class Solution {
    public String longestCommonPrefix(String[] strs) {
     if (strs.length == 1){
            return strs[0];
        }
        StringBuilder sb = new StringBuilder();
        if (strs.length>1) {
            int len = strs[0].length();
            for (int i = 0; i < len; i++) {
                char curr = strs[0].charAt(i);
                for (int j = 1; j < strs.length; j++) {
                    if (strs[j].length()<=i ||strs[j].charAt(i) != curr) {
                        return sb.toString();
                    }
                    if (strs[j].charAt(i) == curr && j == strs.length - 1) {
                        sb.append(curr);
                    }
                }
            }
        }
       return sb.toString();
    }
}

Guess you like

Origin blog.51cto.com/14127893/2414047