diff --git "a/Programmers/\354\243\274\354\213\235\352\260\200\352\262\251.cpp" "b/Programmers/\354\243\274\354\213\235\352\260\200\352\262\251.cpp" new file mode 100644 index 0000000..51dabab --- /dev/null +++ "b/Programmers/\354\243\274\354\213\235\352\260\200\352\262\251.cpp" @@ -0,0 +1,22 @@ +#include +#include + +using namespace std; + +std::vector solution(std::vector prices) { + int size = prices.size(); + std::vector answer(size); + + for(int i = 0; i < size; i++) { + int duration = 0; + + for(int j = i + 1; j < size; j++) { + duration++; + if(prices[i] > prices[j]) break; + } + + answer[i] = duration; + } + + return answer; +} \ No newline at end of file