LeetCode—821. Shortest Distance to a Character


//url:https://leetcode.com/problems/shortest-distance-to-a-character/description/
//最短的距离,取决于该位置左右两边目标C位置的距离
class Solution {
public:
    vector shortestToChar(string S, char C) {
        vector result;
        int firstMeet=-1;
        int lastMeet=-1;
        for(int i=0;i

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注