We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/** * @param {string} s * @return {number} */ var lengthOfLongestSubstring = function(s) { const map = {}; let left = 0; return s.split('').reduce((max, v, i) => { left = map[v] >= left ? map[v] + 1 : left; map[v] = i; return Math.max(max, i - left + 1); }, 0); };
https://blog.logrocket.com/immutability-in-react-ebe55253a1cc/
https://www.jianshu.com/p/ccba80f34f33
https://www.npmjs.com/package/react-native-circular-progress
import React, { Component } from 'react' import { AnimatedCircularProgress } from 'react-native-circular-progress' import { Platform, StyleSheet, Text, View } from 'react-native' import { scaleFontSize, scaleSize, scaleLandScapeSize } from '../../utils/screen' import proptypes from 'prop-types' const styles = StyleSheet.create({ scoreContainer: { alignItems: 'center', paddingVertical: scaleSize(5), paddingHorizontal: scaleSize(20) }, scoreText: { marginTop: scaleSize(5), fontSize: scaleFontSize(8) } }) export default class ScoreCircle extends React.Component { static proptypes = { score: proptypes.number, color: proptypes.string, category: proptypes.string } constructor(props) { super(props); this.state = { } } render() { return ( <View style={[styles.scoreContainer, this.props.scoreStyle]} > <AnimatedCircularProgress size={scaleSize(80)} width={scaleSize(6)} lineCap='round' fill={this.props.score} tintColor={this.props.color} backgroundColor='rgba(150,150,150,.2)' >{ (fill) => ( <Text> {this.props.score + _('分')} </Text> ) } </AnimatedCircularProgress> <Text style={styles.scoreText}> {this.props.category} </Text> </View> ); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Algorithm 无重复字符的最长子串
使用map来记录当前最长子串的每个字符的位置,left记录当前最长子串的起始位置,遍历数组,当遇到重复字符时(map[v] >=left),重复说明map[v]有值不等于undefined,该表达式成立,则更新该字符的位置和起始位置往后移一位。直到数组遍历一遍。
执行用时:120 ms
Review React的immutable:改变对象没有错
https://blog.logrocket.com/immutability-in-react-ebe55253a1cc/
Tip React Native 开发实用技巧
https://www.jianshu.com/p/ccba80f34f33
Share React Native 圆形进度条组件
https://www.npmjs.com/package/react-native-circular-progress
The text was updated successfully, but these errors were encountered: